#72674 by kkaefer. Make adding menu items for local tasks not interfere with the local task.
parent
72fc8dbc98
commit
968a51a442
|
@ -1101,9 +1101,14 @@ function _menu_build() {
|
||||||
if ($old_mid < 0) {
|
if ($old_mid < 0) {
|
||||||
// It had a temporary ID, so use a permanent one.
|
// It had a temporary ID, so use a permanent one.
|
||||||
$_menu['items'][$item->mid] = $_menu['items'][$old_mid];
|
$_menu['items'][$item->mid] = $_menu['items'][$old_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]);
|
unset($_menu['items'][$old_mid]);
|
||||||
$_menu['path index'][$item->path] = $item->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 {
|
else {
|
||||||
// It has a permanent ID. Only replace with non-custom menu items.
|
// It has a permanent ID. Only replace with non-custom menu items.
|
||||||
if ($item->type & MENU_CREATED_BY_ADMIN) {
|
if ($item->type & MENU_CREATED_BY_ADMIN) {
|
||||||
|
@ -1258,6 +1263,11 @@ function _menu_append_contextual_items() {
|
||||||
$_menu['items'][$mid]['callback arguments'] = $item['callback arguments'];
|
$_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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue