Index: modules/menu/menu.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/menu/menu.admin.inc,v retrieving revision 1.90 diff -u -p -r1.90 menu.admin.inc --- modules/menu/menu.admin.inc 20 Oct 2010 07:40:59 -0000 1.90 +++ modules/menu/menu.admin.inc 16 Dec 2010 05:17:17 -0000 @@ -328,7 +328,7 @@ function menu_edit_item($form, &$form_st // Generate a list of possible parents (not including this link or descendants). $options = menu_parent_options(menu_get_menus(), $item); - $default = $item['menu_name'] . ':' . $item['plid']; + $default = ($link['mlid'] ? $item['menu_name'] . ':' . $item['plid'] : 'main-menu:0'); if (!isset($options[$default])) { $default = 'navigation:0'; } Index: modules/menu/menu.install =================================================================== RCS file: /cvs/drupal/drupal/modules/menu/menu.install,v retrieving revision 1.26 diff -u -p -r1.26 menu.install --- modules/menu/menu.install 23 Aug 2010 23:38:06 -0000 1.26 +++ modules/menu/menu.install 16 Dec 2010 05:17:18 -0000 @@ -70,3 +70,22 @@ function menu_uninstall() { menu_rebuild(); } +/** + * Upgrade path for finer node menu controls (http://drupal.org/node/351249) + */ +function menu_update_7000() { + // Retain Drupal 6 menu setting for node parents or set all menus if such + // setting was not found (such as a previously running Drupal 7 site). + $d6_menu_setting = variable_get('menu_default_node_menu', NULL); + $menus = (is_null($d6_menu_setting) ? array_keys(menu_get_menus()) : array($d6_menu_setting)); + + // Store the menu setting for each node type. + $node_types = node_type_get_types(); + foreach($node_types as $key => $type) { + $type_menus = variable_get('menu_options_' . $key, NULL); + // Check with is_null() so we leave empty settings untouched, if present. + if (is_null($type_menus)) { + variable_set('menu_options_' . $key, $menus); + } + } +}