Created
May 2, 2014 11:18
-
-
Save boyron/4102aa67452fafdd1331 to your computer and use it in GitHub Desktop.
Drupal views: force contextual filter to use logical OR condition
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @file: MY_MODULE.views.inc | |
* | |
* Implementation of hook_views_query_alter(). | |
* @param view $view | |
* @param views_plugin_query_default $query | |
*/ | |
function MY_MODULE_views_query_alter(&$view, &$query) { | |
if ($view->name == 'MY_VIEW') { | |
$query->where[0]['type'] = 'OR'; | |
} | |
} | |
/** | |
* @file: MY_MODULE.module | |
* | |
* Implemented hook_views_api(). | |
*/ | |
function MY_MODULE_views_api() { | |
return array( | |
'api' => 3, | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment