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');
?>
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

vishun’s picture

Issue summary: View changes

Included php tags for syntax highlighting

vishun’s picture

Status: Active » Needs review
FileSize
734 bytes
vishun’s picture

Issue summary: View changes

Removed specification of function arguments that match the default.

joelpittet’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)

Last update was 2012, going to close as outdated because it's against 6.x branch.