summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEarl Miles2010-02-01 20:24:52 (GMT)
committer Earl Miles2010-02-01 20:24:52 (GMT)
commit6d1646cfb5b46e6e6933071d6fa88d88cb79431d (patch)
tree1eb84dc3089798f0b514dfcbb66f1147436a220c
parentbc89d324c6970e097c9a7206ffa1c027bfc9b7cb (diff)
#604976: Prevent Page Manager from throwing errors when no modules that provide variants are available.
-rw-r--r--CHANGELOG.txt1
-rw-r--r--page_manager/page_manager.admin.inc6
-rw-r--r--page_manager/plugins/tasks/page.admin.inc5
3 files changed, 12 insertions, 0 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index a4f0da6..87a5fe8 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -35,6 +35,7 @@ Change plugins to no longer need magic function. Can now use $plugin = array(...
#662242: Page Manager was not removing menu items when pages were deleted due to caching.
#639548: export.inc cache was not properly respected when loading individual items, leading to multiple redundant queries.
#544438: Extend user context to allow selection of user, including "logged in user".
+#604976: Prevent Page Manager from throwing errors when no modules that provide variants are available.
ctools 6.x-1.x-dev
==================
diff --git a/page_manager/page_manager.admin.inc b/page_manager/page_manager.admin.inc
index 82b4689..c0b7236 100644
--- a/page_manager/page_manager.admin.inc
+++ b/page_manager/page_manager.admin.inc
@@ -1306,6 +1306,12 @@ function page_manager_handler_add_cancel(&$form_state) {
function page_manager_handler_add_form(&$form, $form_state, $features = array()) {
$task = $form_state['task'];
$task_handler_plugins = page_manager_get_task_handler_plugins($task);
+ if (empty($task_handler_plugins)) {
+ drupal_set_message(t('There are currently no variants available and a page may not be added. Perhaps you need to install the Panels module to get a variant?'), 'error');
+ $form['buttons']['return']['#disabled'] = TRUE;
+ return;
+ }
+
foreach ($task_handler_plugins as $id => $plugin) {
$options[$id] = $plugin['title'];
if (isset($plugin['add features'])) {
diff --git a/page_manager/plugins/tasks/page.admin.inc b/page_manager/plugins/tasks/page.admin.inc
index 1aec3ba..72269af 100644
--- a/page_manager/plugins/tasks/page.admin.inc
+++ b/page_manager/plugins/tasks/page.admin.inc
@@ -189,6 +189,11 @@ function page_manager_page_menu_item($task, $menu, $access_arguments, $page_argu
*/
function page_manager_page_add_subtask($task_name = NULL, $step = NULL) {
$task = page_manager_get_task('page');
+ $task_handler_plugins = page_manager_get_task_handler_plugins($task);
+ if (empty($task_handler_plugins)) {
+ drupal_set_message(t('There are currently no variants available and a page may not be added. Perhaps you need to install the Panels module to get a variant?'), 'error');
+ return ' ';
+ }
$form_info = array(
'id' => 'page_manager_add_page',