From 513725f5ac4a234362c3979713c03857b0e0bd6f Mon Sep 17 00:00:00 2001 From: William Hearn Date: Wed, 17 Aug 2016 23:21:09 -0400 Subject: [PATCH] Issue #2785915 by dsnopek: Panels permissions update causes access denied on page manager pages --- panels.module | 17 +++++++++++++++++ panels_mini/panels_mini.module | 15 +++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/panels.module b/panels.module index cf3a73e..19d68a2 100644 --- a/panels.module +++ b/panels.module @@ -1813,6 +1813,23 @@ function panels_page_manager_handler_add_validate($form, &$form_state) { } } +/** + * Implements hook_default_page_manager_handlers_alter(). + * + * If a default Panels display has no storage type, set it. + */ +function panels_default_page_manager_handlers_alter(&$handlers) { + foreach ($handlers as &$handler) { + if ($handler->handler = 'panel_context') { + $display =& $handler->conf['display']; + if (empty($display->storage_type)) { + $display->storage_type = 'page_manager'; + $display->storage_id = $handler->name; + } + } + } +} + // -------------------------------------------------------------------------- // General utility functions diff --git a/panels_mini/panels_mini.module b/panels_mini/panels_mini.module index e55c673..4a64de2 100644 --- a/panels_mini/panels_mini.module +++ b/panels_mini/panels_mini.module @@ -431,6 +431,21 @@ function panels_mini_ctools_plugin_directory($module, $plugin) { } /** + * Implements hook_default_panels_mini_alter(). + * + * If a default Panels display has no storage type, set it. + */ +function panels_default_panels_mini_alter(&$mini_panels) { + foreach ($mini_panels as &$mini_panel) { + $display =& $mini_panel->display; + if (empty($display->storage_type)) { + $display->storage_type = 'panels_mini'; + $display->storage_id = $mini_panel->name; + } + } +} + +/** * Get the display cache for the panels_mini plugin. */ function _panels_mini_panels_cache_get($key) { -- 2.5.4 (Apple Git-61)