summaryrefslogtreecommitdiff
path: root/modules/menu/menu.module
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2008-11-13 05:54:35 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2008-11-13 05:54:35 +0000
commitd8aafce20dc57e43eed2e469dd60b0ddf3d6a23d (patch)
treeaba60bf7e385d472f5b695fbd8bf4158ea22528e /modules/menu/menu.module
parent8cea8dad029acd225e61576b1e8c6065ddcc7197 (diff)
downloadbrdo-d8aafce20dc57e43eed2e469dd60b0ddf3d6a23d.tar.gz
brdo-d8aafce20dc57e43eed2e469dd60b0ddf3d6a23d.tar.bz2
#328110 by marcingy, Damien Tournoud, swentel, and pwolanin: Fix error on admin/build/menu, and robustify the test so we catch stuff like this in the future.
Diffstat (limited to 'modules/menu/menu.module')
-rw-r--r--modules/menu/menu.module8
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/menu/menu.module b/modules/menu/menu.module
index cc2fcb69c..656a87a8a 100644
--- a/modules/menu/menu.module
+++ b/modules/menu/menu.module
@@ -154,11 +154,13 @@ function menu_theme() {
*/
function menu_enable() {
menu_rebuild();
- $link = db_fetch_array(db_query("SELECT mlid AS plid, menu_name from {menu_links} WHERE link_path = 'admin/build/menu' AND module = 'system'"));
- $link['router_path'] = 'admin/build/menu-customize/%';
- $link['module'] = 'menu';
+ $base_link = db_fetch_array(db_query("SELECT mlid AS plid, menu_name from {menu_links} WHERE link_path = 'admin/build/menu' AND module = 'system'"));
+ $base_link['router_path'] = 'admin/build/menu-customize/%';
+ $base_link['module'] = 'menu';
$result = db_query("SELECT * FROM {menu_custom}");
while ($menu = db_fetch_array($result)) {
+ // $link is passed by reference to menu_link_save(), so we make a copy of $base_link.
+ $link = $base_link;
$link['mlid'] = 0;
$link['link_title'] = $menu['title'];
$link['link_path'] = 'admin/build/menu-customize/' . $menu['menu_name'];