diff --git a/core/includes/form.inc b/core/includes/form.inc index d2cfd47..c1f5620 100644 --- a/core/includes/form.inc +++ b/core/includes/form.inc @@ -371,21 +371,7 @@ function template_preprocess_form(&$variables) { if (!empty($error_links)) { // We need to pass this through String::format() so drupal_set_message() // doesn't encode the links. - $error_count = count($error_links); - $last_error_link = array_pop($error_links); - $starting_error_links = implode(', ', $error_links); - if ($error_count > 2) { - // The style guide requires a serial comma. - $starting_error_links .= ','; - } - $message = \Drupal::translation()->formatPlural($error_count, - '1 error has been found: !last_error_link.', - '@count errors have been found: !starting_error_links and !last_error_link.', - [ - '!starting_error_links' => $starting_error_links, - '!last_error_link' => $last_error_link, - ] - ); + $message = \Drupal::translation()->formatPlural(count($error_links), '1 error has been found', '@count errors have been found') . ': ' . implode(', ', $error_links); $message = String::format($message, $error_titles); drupal_set_message($message, 'error'); }