Index: includes/menu.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/menu.inc,v retrieving revision 1.139 diff -u -d -F^\s*function -r1.139 menu.inc --- includes/menu.inc 23 Oct 2006 17:57:31 -0000 1.139 +++ includes/menu.inc 5 Nov 2006 11:44:08 -0000 @@ -1101,8 +1101,13 @@ function _menu_build() { if ($old_mid < 0) { // It had a temporary ID, so use a permanent one. $_menu['items'][$item->mid] = $_menu['items'][$old_mid]; - unset($_menu['items'][$old_mid]); - $_menu['path index'][$item->path] = $item->mid; + if ($_menu['items'][$item->mid]['type'] & $item->type) { + // If the item is of the same type, delete the old item. + unset($_menu['items'][$old_mid]); + $_menu['path index'][$item->path] = $item->mid; + } + // The new menu item gets all the custom type flags from the database + $_menu['items'][$item->mid]['type'] &= $item->type; } else { // It has a permanent ID. Only replace with non-custom menu items. @@ -1258,6 +1263,11 @@ function _menu_append_contextual_items() $_menu['items'][$mid]['callback arguments'] = $item['callback arguments']; } } + if ($item['type'] & MENU_LOCAL_TASK && !($_menu['items'][$mid]['type'] & MENU_LOCAL_TASK)) { + // A local task is in the menu table and the path is already present + $_menu['items'][$mid]['type'] = MENU_LOCAL_TASK; + $new_items[$mid] = $item; + } } }