diff --git a/core/lib/Drupal/Core/Form/FormErrorHandler.php b/core/lib/Drupal/Core/Form/FormErrorHandler.php index 075c53d..df91969 100644 --- a/core/lib/Drupal/Core/Form/FormErrorHandler.php +++ b/core/lib/Drupal/Core/Form/FormErrorHandler.php @@ -76,13 +76,15 @@ protected function displayErrorMessages(FormStateInterface $form_state) { foreach ($this->errorLinkElements as $form_element) { $title = FormElementHelper::getElementTitle($form_element); - // Only show links to erroneous elements that are visible + // Only show links to erroneous elements that are visible. $is_visible_element = Element::isVisibleElement($form_element); - // And don't show links to elements which use their parent element for inline errors + // And don't show links to elements which use their parent element for + // inline errors. $not_use_parent = empty($form_element['#error_use_parent']); - // And only show links for elements that have a title themselves or have children with a title + // And only show links for elements that have a title themselves or have + // children with a title. $has_title = !empty($title); - // And only show links for elements with an id + // And only show links for elements with an ID. $has_id = !empty($form_element['#id']); if ($is_visible_element && $not_use_parent && $has_title && $has_id) { @@ -94,7 +96,7 @@ protected function displayErrorMessages(FormStateInterface $form_state) { } } - // For all left over errors set normal error messages + // For all left over errors set normal error messages. foreach ($errors as $error) { $this->drupalSetMessage($error, 'error'); } @@ -116,7 +118,7 @@ protected function displayErrorMessages(FormStateInterface $form_state) { } /** - * Stores the errors of each element directly on the element and keep a list + * Stores the errors of each element directly on the element and keeps a list * of these elements * * We must provide a way for non-form functions to check the errors for a