Skip to content
Snippets Groups Projects
Commit 6f7c56cf authored by Jess's avatar Jess
Browse files

Revert "Issue #2853509 by alexpott: Don't render status messages if there are no messages"

This reverts commit 78ca5677.
parent 1d1f11bc
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -73,22 +73,17 @@ public static function generatePlaceholder(array $element) { ...@@ -73,22 +73,17 @@ public static function generatePlaceholder(array $element) {
* @see drupal_get_messages() * @see drupal_get_messages()
*/ */
public static function renderMessages($type) { public static function renderMessages($type) {
$render = []; // Render the messages.
$messages = drupal_get_messages($type); return [
if ($messages) { '#theme' => 'status_messages',
// Render the messages. // @todo Improve when https://www.drupal.org/node/2278383 lands.
$render = [ '#message_list' => drupal_get_messages($type),
'#theme' => 'status_messages', '#status_headings' => [
// @todo Improve when https://www.drupal.org/node/2278383 lands. 'status' => t('Status message'),
'#message_list' => $messages, 'error' => t('Error message'),
'#status_headings' => [ 'warning' => t('Warning message'),
'status' => t('Status message'), ],
'error' => t('Error message'), ];
'warning' => t('Warning message'),
],
];
}
return $render;
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment