summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2008-02-23 08:10:03 +0000
committerDries Buytaert <dries@buytaert.net>2008-02-23 08:10:03 +0000
commitca88c5f4c1b9d334aac04fb9925a84122b97790f (patch)
treea25b6d9fe89376aa1b86e74801101dfd8e3fd085
parent6030a5b2e4b11333ff8ba8f225a53cef6c4303eb (diff)
downloadbrdo-ca88c5f4c1b9d334aac04fb9925a84122b97790f.tar.gz
brdo-ca88c5f4c1b9d334aac04fb9925a84122b97790f.tar.bz2
- Patch #220953 by pwolanin: fixed bug in _menu_navigation_links_rebuild().
-rw-r--r--includes/menu.inc6
1 files changed, 4 insertions, 2 deletions
diff --git a/includes/menu.inc b/includes/menu.inc
index 6c7cd0218..811dfd253 100644
--- a/includes/menu.inc
+++ b/includes/menu.inc
@@ -1693,11 +1693,13 @@ function _menu_navigation_links_rebuild($menu) {
array_multisort($sort, SORT_NUMERIC, $menu_links);
foreach ($menu_links as $item) {
- $existing_item = db_fetch_array(db_query("SELECT mlid, menu_name, plid, customized FROM {menu_links} WHERE link_path = '%s' AND module = '%s'", $item['link_path'], 'system'));
+ $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'];
+ $item['has_children'] = $existing_item['has_children'];
+ $item['updated'] = $existing_item['updated'];
}
if (!$existing_item || !$existing_item['customized']) {
menu_link_save($item);
@@ -1719,7 +1721,7 @@ function _menu_navigation_links_rebuild($menu) {
}
}
// Find any items where their router path does not exist any more.
- $result = db_query('SELECT * FROM {menu_links} WHERE router_path NOT IN ('. $placeholders .') AND external = 0 AND updated = 0 AND customized = 0 ORDER BY depth DESC', array_keys($menu));
+ $result = db_query("SELECT * FROM {menu_links} WHERE router_path NOT IN ($placeholders) AND external = 0 AND updated = 0 AND customized = 0 ORDER BY depth DESC", $paths);
// Remove all such items. Starting from those with the greatest depth will
// minimize the amount of re-parenting done by menu_link_delete().
while ($item = db_fetch_array($result)) {