diff --git a/core/lib/Drupal/Core/Menu/LocalTaskManager.php b/core/lib/Drupal/Core/Menu/LocalTaskManager.php index bfe56ac..229f152 100644 --- a/core/lib/Drupal/Core/Menu/LocalTaskManager.php +++ b/core/lib/Drupal/Core/Menu/LocalTaskManager.php @@ -182,7 +182,11 @@ public function getLocalTasksForRoute($route_name) { $base_routes = array(); $parents = array(); $children = array(); - foreach ($definitions as $plugin_id => $task_info) { + foreach ($definitions as $plugin_id => &$task_info) { + // Fill in the base_route from the parent to insure consistency. + if (!empty($task_info['parent_id']) && !empty($definitions[$task_info['parent_id']])) { + $task_info['base_route'] = $definitions[$task_info['parent_id']]['base_route']; + } if ($route_name == $task_info['route_name']) { if(!empty($task_info['base_route'])) { $base_routes[$task_info['base_route']] = $task_info['base_route']; @@ -201,11 +205,6 @@ public function getLocalTasksForRoute($route_name) { // Find all the plugins with the same root and that are at the top // level or that have a visible parent. foreach ($definitions as $plugin_id => $task_info) { - // Fill in the base_route from the parent to insure consistency. - if (!empty($task_info['parent_id']) && isset($definitions[$task_info['parent_id']])) { - // Fill in the base_route from the parent to insure consistency. - $task_info['base_route'] = $definitions[$task_info['parent_id']]['base_route']; - } if (!empty($base_routes[$task_info['base_route']]) && (empty($task_info['parent_id']) || !empty($parents[$task_info['parent_id']]))) { // Concat '> ' with root ID for the parent of top-level tabs. $parent = empty($task_info['parent_id']) ? '> ' . $task_info['base_route'] : $task_info['parent_id']; diff --git a/core/modules/block/lib/Drupal/block/Plugin/Derivative/ThemeLocalTask.php b/core/modules/block/lib/Drupal/block/Plugin/Derivative/ThemeLocalTask.php index 77a2235..9988813 100644 --- a/core/modules/block/lib/Drupal/block/Plugin/Derivative/ThemeLocalTask.php +++ b/core/modules/block/lib/Drupal/block/Plugin/Derivative/ThemeLocalTask.php @@ -56,8 +56,8 @@ public function getDerivativeDefinitions(array $base_plugin_definition) { // Default task! if ($default_theme == $theme_name) { $this->derivatives[$theme_name]['route_name'] = 'block.admin_display'; - // Emulate default logic because without the base plugin id we can't set the - // change the tab_root_id. + // Emulate default logic because without the base plugin id we can't + // change the base_route. $this->derivatives[$theme_name]['weight'] = -10; unset($this->derivatives[$theme_name]['route_parameters']); diff --git a/core/modules/user/user.local_tasks.yml b/core/modules/user/user.local_tasks.yml index 5067808..f310e08 100644 --- a/core/modules/user/user.local_tasks.yml +++ b/core/modules/user/user.local_tasks.yml @@ -1,7 +1,3 @@ -user.role_list_tab: - route_name: user.role_list - title: 'Roles' - base_route: user.role_list_tab user.role_edit: title: 'Edit' @@ -50,3 +46,9 @@ user.admin_permissions: title: Permissions route_name: user.admin_permissions base_route: user.admin_account + +user.role_list: + title: 'Roles' + route_name: user.role_list + base_route: user.role_list + weight: 10