You are here

function mediafront_views_query_alter in MediaFront 6.2

Same name and namespace in other branches
  1. 6 mediafront.module \mediafront_views_query_alter()
  2. 7 mediafront.module \mediafront_views_query_alter()

Implements hook_views_query_alter().

This is a HACK until I can convince the views maintainers to take my patch found at http://drupal.org/node/857946

File

./mediafront.module, line 773

Code

function mediafront_views_query_alter(&$view, &$query) {
  if ($view->style_plugin->definition['handler'] == 'mediafront_plugin_style_player') {
    if (!isset($query->fields) || !in_array('nid', array_keys($query->fields))) {
      $query
        ->add_field($query->base_table, 'nid');
    }
  }
}