Closed (duplicate)
Project:
Drupal core
Version:
8.0.x-dev
Component:
theme system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
18 Mar 2013 at 20:21 UTC
Updated:
29 Jul 2014 at 22:03 UTC
When there are multiple messages, the key is not used. But when there is only one, the expected key is 0, which is not always correct (for example #1945758: Work around theme_status_messages() limitation to display checkout form errors outside panes).
if (count($messages) > 1) {
$output .= " <ul>\n";
foreach ($messages as $message) {
$output .= ' <li>' . $message . "</li>\n";
}
$output .= " </ul>\n";
}
else {
$output .= $messages[0];
}
I'm not sure if it is a bug, or if we want to keep the core simple.
Comments
Comment #1
rszrama commentedHope you don't mind me closing this, but I'd already made this a separate issue against 7.x (as this will be deprecated in 8.x by the change to TWIG).
See: #1946240: Remove the hardcoded 0 index in theme_status_messages()
Comment #2
jcisio commentedNo problem, you created that issue 3 minutes before mine ;)