core/lib/Drupal/Core/Form/FormBuilder.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/lib/Drupal/Core/Form/FormBuilder.php b/core/lib/Drupal/Core/Form/FormBuilder.php index d82c8c4..bb3bfee 100644 --- a/core/lib/Drupal/Core/Form/FormBuilder.php +++ b/core/lib/Drupal/Core/Form/FormBuilder.php @@ -615,6 +615,11 @@ public function prepareForm($form_id, &$form, FormStateInterface &$form_state) { $form['#action'] = $this->buildFormAction(); } + // If the form method is specified in the form, pass it on to FormState. + if (isset($form['#method'])) { + $form_state->setMethod($form['#method']); + } + // Fix the form method, if it is 'get' in $form_state, but not in $form. if ($form_state->isMethodType('get') && !isset($form['#method'])) { $form['#method'] = 'get';