The function editablefields_view() has an area that returns messages set by drupal_set_message() only if they are the default level of 'status'. Is there any particular reason this design choice was made? It would seem that 'warning' and 'error' level messages would also be pretty important for an end-user to be made aware of whether or not their change took place and what potentially went wrong.
Original:
<?php
$messages = drupal_get_messages('status', TRUE);
if (count($messages) > 0) {
foreach ($messages as $type => $messages) {
foreach ($messages as $message) {
$output .= '<div class="messages ' . $type . '">' . $message . "</div>";
}
}
}
?>
One solution:
<?php
$messages = drupal_get_messages();
if (count($messages) > 0) {
foreach ($messages as $type => $messages) {
foreach ($messages as $message) {
$output .= '<div class="messages ' . $type . '">' . $message . "</div>";
}
}
}
?>
Optimal solution that AHAH uses:
<?php
$output .= theme('status_messages');
?>
Comments
Comment #0.0
vishun commentedIncluded php tags for syntax highlighting
Comment #1
vishun commentedComment #1.0
vishun commentedRemoved specification of function arguments that match the default.
Comment #2
joelpittetLast update was 2012, going to close as outdated because it's against 6.x branch.