diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2008-09-02 19:23:02 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2008-09-02 19:23:02 +0000 |
commit | c17a5e70bca3113bc7e9dbb42c01e9abe47aa063 (patch) | |
tree | 5dd373f83c2921f7217f7b65516e07b90c18a64c /includes | |
parent | 6511f56e4b62f667138b6bab184b20c53e651cee (diff) | |
download | brdo-c17a5e70bca3113bc7e9dbb42c01e9abe47aa063.tar.gz brdo-c17a5e70bca3113bc7e9dbb42c01e9abe47aa063.tar.bz2 |
#285309 by pwolanin: menu_name in hook_menu is ignored on updates
Diffstat (limited to 'includes')
-rw-r--r-- | includes/menu.inc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/includes/menu.inc b/includes/menu.inc index b5a64af25..367369dcb 100644 --- a/includes/menu.inc +++ b/includes/menu.inc @@ -1787,8 +1787,11 @@ function _menu_navigation_links_rebuild($menu) { $existing_item = db_fetch_array(db_query("SELECT mlid, menu_name, plid, customized, has_children, updated FROM {menu_links} WHERE link_path = '%s' AND module = '%s'", $item['link_path'], 'system')); if ($existing_item) { $item['mlid'] = $existing_item['mlid']; - $item['menu_name'] = $existing_item['menu_name']; - $item['plid'] = $existing_item['plid']; + // A change in hook_menu may move the link to a different menu + if (empty($item['menu_name']) || ($item['menu_name'] == $existing_item['menu_name'])) { + $item['menu_name'] = $existing_item['menu_name']; + $item['plid'] = $existing_item['plid']; + } $item['has_children'] = $existing_item['has_children']; $item['updated'] = $existing_item['updated']; } |