summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-10-14 21:38:12 +0000
committerDries Buytaert <dries@buytaert.net>2004-10-14 21:38:12 +0000
commit12eb20238ce54680995b58f1fef529bae4052ed0 (patch)
tree4929ced9fddc4f06e59e282518453fd42cf831db
parent4a0e047469e277cec9f1d1635b5de8c6568d614b (diff)
downloadbrdo-12eb20238ce54680995b58f1fef529bae4052ed0.tar.gz
brdo-12eb20238ce54680995b58f1fef529bae4052ed0.tar.bz2
- Patch #11430 by JonBob: reseting the menus broke the admin pages.
-rw-r--r--includes/menu.inc14
1 files changed, 9 insertions, 5 deletions
diff --git a/includes/menu.inc b/includes/menu.inc
index 889828d8e..729a202b8 100644
--- a/includes/menu.inc
+++ b/includes/menu.inc
@@ -496,6 +496,8 @@ function menu_rebuild() {
// Also clear the menu cache.
cache_clear_all('menu:', TRUE);
+ _menu_build();
+
if (module_exist('menu')) {
$menu = menu_get_menu();
@@ -523,13 +525,15 @@ function menu_rebuild() {
}
}
- foreach ($new_items as $item) {
- db_query('INSERT INTO {menu} (mid, pid, path, title, description, weight, type) VALUES (%d, %d, \'%s\', \'%s\', \'%s\', %d, %d)', $item['mid'], $item['pid'], $item['path'], $item['title'], $item['description'], $item['weight'], $item['type']);
+ if (count($new_items) > 1) {
+ foreach ($new_items as $item) {
+ db_query('INSERT INTO {menu} (mid, pid, path, title, description, weight, type) VALUES (%d, %d, \'%s\', \'%s\', \'%s\', %d, %d)', $item['mid'], $item['pid'], $item['path'], $item['title'], $item['description'], $item['weight'], $item['type']);
+ }
+
+ // Rebuild the menu to account for the changes.
+ _menu_build();
}
}
-
- // Rebuild the menu to account for any changes.
- _menu_build();
}
/**