Commit 6f7c56cf authored by xjm's avatar xjm

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

This reverts commit 78ca5677.
parent 1d1f11bc
......@@ -73,22 +73,17 @@ public static function generatePlaceholder(array $element) {
* @see drupal_get_messages()
*/
public static function renderMessages($type) {
$render = [];
$messages = drupal_get_messages($type);
if ($messages) {
// Render the messages.
$render = [
'#theme' => 'status_messages',
// @todo Improve when https://www.drupal.org/node/2278383 lands.
'#message_list' => $messages,
'#status_headings' => [
'status' => t('Status message'),
'error' => t('Error message'),
'warning' => t('Warning message'),
],
];
}
return $render;
// Render the messages.
return [
'#theme' => 'status_messages',
// @todo Improve when https://www.drupal.org/node/2278383 lands.
'#message_list' => drupal_get_messages($type),
'#status_headings' => [
'status' => t('Status message'),
'error' => t('Error message'),
'warning' => t('Warning message'),
],
];
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment