diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2008-11-13 05:54:35 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2008-11-13 05:54:35 +0000 |
commit | d8aafce20dc57e43eed2e469dd60b0ddf3d6a23d (patch) | |
tree | aba60bf7e385d472f5b695fbd8bf4158ea22528e /includes | |
parent | 8cea8dad029acd225e61576b1e8c6065ddcc7197 (diff) | |
download | brdo-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 'includes')
-rw-r--r-- | includes/menu.inc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/includes/menu.inc b/includes/menu.inc index fdcc1bf4e..2cd620770 100644 --- a/includes/menu.inc +++ b/includes/menu.inc @@ -1911,7 +1911,9 @@ function menu_link_save(&$item) { ); $existing_item = FALSE; if (isset($item['mlid'])) { - $existing_item = db_fetch_array(db_query("SELECT * FROM {menu_links} WHERE mlid = %d", $item['mlid'])); + if ($existing_item = db_fetch_array(db_query("SELECT * FROM {menu_links} WHERE mlid = %d", $item['mlid']))) { + $existing_item['options'] = unserialize($existing_item['options']); + } } if (isset($item['plid'])) { @@ -2016,7 +2018,6 @@ function menu_link_save(&$item) { $item['router_path'] = _menu_find_router_path($menu, $item['link_path']); } } - $item['options'] = serialize($item['options']); // If every value in $existing_item is the same in the $item, there is no // reason to run the update queries or clear the caches. We use // array_diff_assoc() with the $existing_item as the first parameter @@ -2032,7 +2033,7 @@ function menu_link_save(&$item) { $item['router_path'], $item['hidden'], $item['external'], $item['has_children'], $item['expanded'], $item['weight'], $item['depth'], $item['p1'], $item['p2'], $item['p3'], $item['p4'], $item['p5'], $item['p6'], $item['p7'], $item['p8'], $item['p9'], - $item['module'], $item['link_title'], $item['options'], $item['customized'], $item['mlid']); + $item['module'], $item['link_title'], serialize($item['options']), $item['customized'], $item['mlid']); // Check the has_children status of the parent. _menu_update_parental_status($item); menu_cache_clear($menu_name); |