Form method of hidden input '_method' is preserved on next request

E.G. When you submitted data across a form with a 'PATCH' method and then in a second submit you use a form with a 'DELETE' method, the FormBuilder::getValueAttribute() method use the previous value of the hidden input '_method'.
So the value is replaced by 'PATCH' instead of the 'DELETE' value.
This commit is contained in:
Tortue Torche authored and GitHub committed 2017-08-09 14:23:33 +02:00
1 parent 9b8f51e7a2
commit 3688b0e433
1 file changed
+1 -1
+1 -1
View File
@@ -1161,7 +1161,7 @@ class FormBuilder
}
$request = $this->request($name);
if (!is_null($request)) {
if (! is_null($request) && $name != '_method') {
return $request;
}