In case anyone wants to know, I was able to accomplish this with some views hooks and will share my solution.
First you need to register view api information
/**
* Implements hook_views_api().
*/
function mymodule_views_api() {
return array(
'api' => 3,
);
}
Then you need to alter the view at pre build to include the "Global" term. I am using entity query to determine if there is any content with the Global term. If so I am adding that term as an argument.
/**
* Implements hook_views_pre_build().
*/
function mymodule_views_pre_build(&$view) {
// we were getting no results if the tid of the Global term was not 1
// in some build instances it is not so we need to ensure that the default
// value being passed is the actual tid of the Global term.
if (($view->name == 'badge' || $view->name == 'promo_box' || $view->name == 'article'|| $view->name == 'tips') && $view->current_display == 'block') {
$vocabulary = taxonomy_vocabulary_machine_name_load('site_section');
$entityQuery = new EntityFieldQuery;
$entityQuery->entityCondition('entity_type', 'taxonomy_term')
->propertyCondition('name', 'Global')
->propertyCondition('vid', $vocabulary->vid)
->range(0 ,1);
$result = $entityQuery->execute();
if ($result) {
$term = array_slice($result['taxonomy_term'], 0);
$view->argument['tid_1']->options['default_argument_options']['argument'] = $term[0]->tid;
}
}
}
And finally you need to switch the where statement to and or
/**
* Implements hook_views_query_alter().
*/
function mymodule_views_query_alter(&$view, &$query) {
// Let's find out if we are attempting to load either the badge or promo box
// view. If so we need to alter the where clause to include an or statement
// in the conditional filter to also look for the global term in the site secttion
// taxonomy. I was not able to find a way to create an OR condition filter via a
// module so for now this is the best to do it.
if (($view->name == 'badge' || $view->name == 'promo_box' || $view->name == 'article'|| $view->name == 'tips') && $view->current_display == 'block') {
if (isset($query->where[0]) && isset($query->where[1])) {
$query->where[0]['type'] = 'OR';
}
}
}