From 3688b0e433b75937b5a47024e8aaf1b9f0c9f870 Mon Sep 17 00:00:00 2001 From: Tortue Torche Date: Wed, 9 Aug 2017 14:23:33 +0200 Subject: [PATCH] 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. --- src/FormBuilder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FormBuilder.php b/src/FormBuilder.php index 8fa8ca8..430de61 100644 --- a/src/FormBuilder.php +++ b/src/FormBuilder.php @@ -1161,7 +1161,7 @@ class FormBuilder } $request = $this->request($name); - if (!is_null($request)) { + if (! is_null($request) && $name != '_method') { return $request; }