From 12eb20238ce54680995b58f1fef529bae4052ed0 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 14 Oct 2004 21:38:12 +0000 Subject: - Patch #11430 by JonBob: reseting the menus broke the admin pages. --- includes/menu.inc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'includes') 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(); } /** -- cgit v1.2.3