If you have a View that acts as a media browser plugin, there is the potential that Drupal error messages can be thrown. For instance, if a taxonomy or user filter is exposed, and you enter a non-existing term or user, Views provides an error message that the user/term doesn't exist. The problem is that the error message does not render until you close the browser and reload the page. Is there a way that we can get the browser to render those messages when they are thrown?

Comments

mstef’s picture

I ended up using the following code. I don't see anywhere in Media where this can be fixed, since the browser dialog is never reloaded. I'm not sure if Views is/should address scenarios like this. Got any ideas?

/**
 * Implements hook_views_post_render().
 */
function hook_views_post_render(&$view, &$output, &$cache) {
  if ($view->plugin_name == 'media_browser') {
    if ($messages = theme('status_messages')) {
      $output = $messages . $output;
    }
  }
}
Chris Matthews’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Closing this issue as outdated. However, if you think this issue is still important, please let us know and we will gladly re-open it for review.
sincerely,
- the Drupal Media Team