diff --git a/core/lib/Drupal/Core/Form/FormValidator.php b/core/lib/Drupal/Core/Form/FormValidator.php index a9a3c83..a6c3fcf 100644 --- a/core/lib/Drupal/Core/Form/FormValidator.php +++ b/core/lib/Drupal/Core/Form/FormValidator.php @@ -218,8 +218,8 @@ protected function doValidateForm(&$elements, FormStateInterface &$form_state, $ // error messages displayed to the user matches the order of elements in // the form. Use a copy of $elements so that it is not modified by the // sorting itself. - $elements_copy = $elements; - foreach (Element::children($elements_copy, TRUE) as $key) { + $elements_sorted = $elements; + foreach (Element::children($elements_sorted, TRUE) as $key) { if (isset($elements[$key]) && $elements[$key]) { $this->doValidateForm($elements[$key], $form_state); }