Skip to content
Snippets Groups Projects
Commit 968a51a4 authored by Neil Drumm's avatar Neil Drumm :wave:
Browse files

#72674 by kkaefer. Make adding menu items for local tasks not interfere with the local task.

parent 72fc8dbc
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment