summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Boyer2008-12-28 08:09:50 (GMT)
committer Sam Boyer2008-12-28 08:09:50 (GMT)
commit6f3aa471028c7f3a922e85ae19b56d3c042a6bbc (patch)
treed5b8911693ce087cc8d2222e4aebc6882ed189fa
parent9e6fa33c712d05fd4bc264db05c947f237c1031a (diff)
#330715: Fixes for more unexpected menu behaviors. Added some more calls to menu_rebuild(), and ensured that items with wildcard paths that have not yet had arguments created for those wildcards are excluded from router item generation in hook_menu_alter().
-rw-r--r--panels_page/panels_page.admin.inc6
-rw-r--r--panels_page/panels_page.menu.inc6
2 files changed, 9 insertions, 3 deletions
diff --git a/panels_page/panels_page.admin.inc b/panels_page/panels_page.admin.inc
index a69b979..a4a09e4 100644
--- a/panels_page/panels_page.admin.inc
+++ b/panels_page/panels_page.admin.inc
@@ -416,15 +416,16 @@ function panels_page_edit_form_submit($form, &$form_state) {
else {
$form_state['redirect'] = "admin/panels/panel-page/$panel_page->name/edit/advanced/next";
}
+ menu_rebuild();
return;
}
else {
drupal_set_message(t('Your changes have been saved.'));
panels_page_load_include('write');
panels_page_save($panel_page);
+ // The path may have changed - rebuild the menu.
+ menu_rebuild();
}
- // The path may have changed - rebuild the menu.
- menu_rebuild();
}
/**
@@ -728,6 +729,7 @@ function panels_page_context_form_submit($form, &$form_state) {
panels_page_load_include('write');
panels_page_save($panel_page);
panels_cache_clear('panel_object:panel_page', $panel_page->name);
+ menu_rebuild();
if ($form_state['next']) {
$form_state['redirect'] = "admin/panels/panel-page/$panel_page->name/edit/content";
}
diff --git a/panels_page/panels_page.menu.inc b/panels_page/panels_page.menu.inc
index 914a7e6..78d104d 100644
--- a/panels_page/panels_page.menu.inc
+++ b/panels_page/panels_page.menu.inc
@@ -268,7 +268,11 @@ function _panels_page_create_menu_structure() {
if (strpos($panel_page->path, '%') === FALSE) {
panels_page_construct_static_menu_link($items, $panel_page, $map);
}
- else {
+ // Only construct dynamic menu items if at least one argument has been
+ // defined. Kinda hacky, but failure to do this check can result in really
+ // icky, non-user-intuitive inconsistencies if someone creates a panel
+ // page on an override path but doesn't give it an argument right away.
+ elseif (!empty($panel_page->arguments)) {
panels_page_construct_dynamic_menu_link($items, $panel_page, $map);
}
}