summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-07-13 21:23:23 +0000
committerDries Buytaert <dries@buytaert.net>2004-07-13 21:23:23 +0000
commit2c9b5e31b7d4dbe2dd344517b1f4dc94c2baa340 (patch)
treeb863fe1e307127ed883662232d80870814e0f909
parentdbd1c4f1da6dd480d56821f4c28cd27f730780bd (diff)
downloadbrdo-2c9b5e31b7d4dbe2dd344517b1f4dc94c2baa340.tar.gz
brdo-2c9b5e31b7d4dbe2dd344517b1f4dc94c2baa340.tar.bz2
- Patch #9234 by TDobes: the latest menu changes have caused custom menu blocks not to render any output. If I create a new menu and menu items, and then enable the block, no output from that block is visible.
This commit fixes the problem: custom menus were being defined as MENU_CUSTOM_ITEM rather than MENU_CUSTOM_MENU. It also fixes a problem in which custom menus were mistakenly given the MENU_VISIBLE_IN_BREADCRUMB bit when edited. This would cause their titles to show up in the breadcrumb (which is undesirable... only menu items should be in there). Note that this will not fix any non-functioning custom menus you've defined since this bug appeared. You'll have to delete and recreate them or update the "type" column in the DB manually.
-rw-r--r--modules/menu.module11
-rw-r--r--modules/menu/menu.module11
2 files changed, 16 insertions, 6 deletions
diff --git a/modules/menu.module b/modules/menu.module
index 438dc8de5..a0f373ff7 100644
--- a/modules/menu.module
+++ b/modules/menu.module
@@ -136,7 +136,7 @@ function menu_add_menu() {
break;
default:
$edit['pid'] = 0;
- $edit['type'] = MENU_CUSTOM_ITEM;
+ $edit['type'] = MENU_CUSTOM_MENU;
$output .= menu_edit_item_form($edit);
}
@@ -275,8 +275,13 @@ function menu_edit_item_form($edit) {
$form .= form_submit(t('Submit'));
$form .= form_hidden('mid', $edit['mid']);
- // Always enable menu items when editing them.
- $form .= form_hidden('type', $edit['type'] | MENU_VISIBLE_IN_TREE | MENU_VISIBLE_IN_BREADCRUMB);
+
+ // Always enable menu items (but not menus) when editing them.
+ if (!($edit['type'] & MENU_IS_ROOT)) {
+ $edit['type'] |= MENU_VISIBLE_IN_TREE | MENU_VISIBLE_IN_BREADCRUMB;
+ }
+
+ $form .= form_hidden('type', $edit['type']);
return form($form);
}
diff --git a/modules/menu/menu.module b/modules/menu/menu.module
index 438dc8de5..a0f373ff7 100644
--- a/modules/menu/menu.module
+++ b/modules/menu/menu.module
@@ -136,7 +136,7 @@ function menu_add_menu() {
break;
default:
$edit['pid'] = 0;
- $edit['type'] = MENU_CUSTOM_ITEM;
+ $edit['type'] = MENU_CUSTOM_MENU;
$output .= menu_edit_item_form($edit);
}
@@ -275,8 +275,13 @@ function menu_edit_item_form($edit) {
$form .= form_submit(t('Submit'));
$form .= form_hidden('mid', $edit['mid']);
- // Always enable menu items when editing them.
- $form .= form_hidden('type', $edit['type'] | MENU_VISIBLE_IN_TREE | MENU_VISIBLE_IN_BREADCRUMB);
+
+ // Always enable menu items (but not menus) when editing them.
+ if (!($edit['type'] & MENU_IS_ROOT)) {
+ $edit['type'] |= MENU_VISIBLE_IN_TREE | MENU_VISIBLE_IN_BREADCRUMB;
+ }
+
+ $form .= form_hidden('type', $edit['type']);
return form($form);
}