Commit 1cc24043 authored by Chris Shantz's avatar Chris Shantz
Browse files

Added update hook to fix issue with sites that have both responsive and...

Added update hook to fix issue with sites that have both responsive and non-responsive views enabled.
parent fc3f188b
......@@ -222,6 +222,30 @@ function uw_ct_event_update_7103() {
}
}
/**
* Repeating update 7103. We found that the install hook was being trumped
* by the enable hook (which did not have the code to disable non-responsive views
* so sites were having both the responsive and non-responsive views enabled.
*/
function uw_ct_event_update_7104() {
watchdog('uw_ct_event', 'enable responsive views function executing');
$views_status = variable_get('views_defaults', array()); //read in any existing disabled views
if (!module_exists('uw_cfg_responsive')) {
$views_status['events_responsive'] = TRUE; //add the responsive view to the disabled list
variable_set('views_defaults', $views_status); //reset the variable with the new list
if (function_exists('views_invalidate_cache')) { //clear the views cache
views_invalidate_cache();
}
} else {
unset($views_status['events_responsive']); //remove the responsive ones from the disabled list
$views_status['events'] = TRUE; // add the standard view to the disabled list
variable_set('views_defaults', $views_status); //reset the variable with the new list
if (function_exists('views_invalidate_cache')) { //clear the views cache
views_invalidate_cache();
}
}
}
/**
* Implements hook_uninstall().
*/
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment