diff --git a/core/lib/Drupal/Core/Menu/LocalTaskDefault.php b/core/lib/Drupal/Core/Menu/LocalTaskDefault.php index ef8d0232e9689c223cb7084f9e31284f16bdd5ba..1f5180a41303eab1cd283785bc6ea21060612ca9 100644 --- a/core/lib/Drupal/Core/Menu/LocalTaskDefault.php +++ b/core/lib/Drupal/Core/Menu/LocalTaskDefault.php @@ -92,7 +92,7 @@ public function getTitle() { public function getWeight() { // By default the weight is 0, or -10 for the root tab. if (!isset($this->pluginDefinition['weight'])) { - if ($this->pluginDefinition['tab_root_id'] == $this->pluginId) { + if ($this->pluginDefinition['base_route'] == $this->pluginDefinition['route_name']) { $this->pluginDefinition['weight'] = -10; } else { diff --git a/core/lib/Drupal/Core/Menu/LocalTaskDerivativeBase.php b/core/lib/Drupal/Core/Menu/LocalTaskDerivativeBase.php deleted file mode 100644 index 5e3cacb45fc87bfea594e66ceb348ce498899eaf..0000000000000000000000000000000000000000 --- a/core/lib/Drupal/Core/Menu/LocalTaskDerivativeBase.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -/** - * @file - * Contains \Drupal\Core\Menu\LocalTaskDerivativeBase. - */ - -namespace Drupal\Core\Menu; - -use Drupal\Component\Plugin\Derivative\DerivativeBase; - -/** - * Provides a getPluginIdFromRoute method for local task derivatives. - */ -class LocalTaskDerivativeBase extends DerivativeBase { - - /** - * Finds the local task ID of a route given the route name. - * - * @param string $route_name - * The route name. - * @param array $local_tasks - * An array of all local task definitions. - * - * @return string|null - * Returns the local task ID of the given route or NULL if none is found. - */ - protected function getPluginIdFromRoute($route_name, &$local_tasks) { - foreach ($local_tasks as $plugin_id => $local_task) { - if ($local_task['route_name'] == $route_name) { - return $plugin_id; - break; - } - } - } - -} diff --git a/core/lib/Drupal/Core/Menu/LocalTaskManager.php b/core/lib/Drupal/Core/Menu/LocalTaskManager.php index e2a2499ae3efb1e220499ae65fdb5dc243a29c85..2649aa7db09a68a7dabb953405abfaa7ae7f7be4 100644 --- a/core/lib/Drupal/Core/Menu/LocalTaskManager.php +++ b/core/lib/Drupal/Core/Menu/LocalTaskManager.php @@ -40,10 +40,10 @@ class LocalTaskManager extends DefaultPluginManager { 'route_parameters' => array(), // The static title for the local task. 'title' => '', - // The plugin ID of the root tab. - 'tab_root_id' => '', + // The route name where the root tab appears. + 'base_route' => '', // The plugin ID of the parent tab (or NULL for the top-level tab). - 'tab_parent_id' => NULL, + 'parent_id' => NULL, // The weight of the tab. 'weight' => NULL, // The default link options. @@ -171,7 +171,7 @@ public function getLocalTasksForRoute($route_name) { if (!isset($this->instances[$route_name])) { $this->instances[$route_name] = array(); if ($cache = $this->cacheBackend->get($this->cacheKey . ':' . $route_name)) { - $tab_root_ids = $cache->data['tab_root_ids']; + $base_routes = $cache->data['base_routes']; $parents = $cache->data['parents']; $children = $cache->data['children']; } @@ -179,47 +179,56 @@ public function getLocalTasksForRoute($route_name) { $definitions = $this->getDefinitions(); // We build the hierarchy by finding all tabs that should // appear on the current route. - $tab_root_ids = array(); + $base_routes = array(); $parents = array(); $children = array(); 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']; + // Populate the definitions we use in the next loop. Using a + // reference like &$task_info causes bugs. + $definitions[$plugin_id]['base_route'] = $definitions[$task_info['parent_id']]['base_route']; + } if ($route_name == $task_info['route_name']) { - $tab_root_ids[$task_info['tab_root_id']] = $task_info['tab_root_id']; + if(!empty($task_info['base_route'])) { + $base_routes[$task_info['base_route']] = $task_info['base_route']; + } // Tabs that link to the current route are viable parents // and their parent and children should be visible also. // @todo - this only works for 2 levels of tabs. // instead need to iterate up. $parents[$plugin_id] = TRUE; - if (!empty($task_info['tab_parent_id'])) { - $parents[$task_info['tab_parent_id']] = TRUE; + if (!empty($task_info['parent_id'])) { + $parents[$task_info['parent_id']] = TRUE; } } } - if ($tab_root_ids) { + if ($base_routes) { // 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) { - if (!empty($tab_root_ids[$task_info['tab_root_id']]) && (empty($task_info['tab_parent_id']) || !empty($parents[$task_info['tab_parent_id']]))) { + 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['tab_parent_id']) ? '> ' . $task_info['tab_root_id'] : $task_info['tab_parent_id']; + $parent = empty($task_info['parent_id']) ? '> ' . $task_info['base_route'] : $task_info['parent_id']; $children[$parent][$plugin_id] = $task_info; } } } $data = array( - 'tab_root_ids' => $tab_root_ids, + 'base_routes' => $base_routes, 'parents' => $parents, 'children' => $children, ); $this->cacheBackend->set($this->cacheKey . ':' . $route_name, $data, CacheBackendInterface::CACHE_PERMANENT, $this->cacheTags); } // Create a plugin instance for each element of the hierarchy. - foreach ($tab_root_ids as $root_id) { + foreach ($base_routes as $base_route) { // Convert the tree keyed by plugin IDs into a simple one with // integer depth. Create instances for each plugin along the way. $level = 0; // We used this above as the top-level parent array key. - $next_parent = '> ' . $root_id; + $next_parent = '> ' . $base_route; do { $parent = $next_parent; $next_parent = FALSE; @@ -283,8 +292,7 @@ public function getTasksBuild($current_route_name) { // The plugin may have been set active in getLocalTasksForRoute() if // one of its child tabs is the active tab. $active = $active || $child->getActive(); - // @todo It might make sense to use menu link entities instead of - // arrays. + // @todo It might make sense to use link render elements instead. $link = array( 'title' => $this->getTitle($child), diff --git a/core/modules/action/action.local_tasks.yml b/core/modules/action/action.local_tasks.yml index b1d0b61829c7a0a8a8217eee9cf7e780511e2592..0ca44138bf3b37453a15ee24f1c373bef04b056d 100644 --- a/core/modules/action/action.local_tasks.yml +++ b/core/modules/action/action.local_tasks.yml @@ -1,4 +1,4 @@ action.admin: route_name: action.admin title: 'Manage actions' - tab_root_id: action.admin + base_route: action.admin diff --git a/core/modules/aggregator/aggregator.local_tasks.yml b/core/modules/aggregator/aggregator.local_tasks.yml index ceb7b45d8b44c6636560b3cec669b6eef18b7afb..b74ecf34128d6ebe1f0f8859a727eb49a41ce1d0 100644 --- a/core/modules/aggregator/aggregator.local_tasks.yml +++ b/core/modules/aggregator/aggregator.local_tasks.yml @@ -1,19 +1,19 @@ aggregator.admin_overview: route_name: aggregator.admin_overview title: 'List' - tab_root_id: aggregator.admin_overview + base_route: aggregator.admin_overview aggregator.admin_settings: route_name: aggregator.admin_settings title: 'Settings' weight: 100 - tab_root_id: aggregator.admin_overview + base_route: aggregator.admin_overview aggregator.feed_view: route_name: aggregator.feed_view - tab_root_id: aggregator.feed_view + base_route: aggregator.feed_view title: View aggregator.feed_configure: route_name: aggregator.feed_configure - tab_root_id: aggregator.feed_view + base_route: aggregator.feed_view title: 'Configure' weight: 10 diff --git a/core/modules/block/block.local_tasks.yml b/core/modules/block/block.local_tasks.yml index 3fdea89d937a1595269dc673c5d371a88b8b2eaf..3d770ed94281a1d1866b4a6e3877e2fd6a065c49 100644 --- a/core/modules/block/block.local_tasks.yml +++ b/core/modules/block/block.local_tasks.yml @@ -1,16 +1,15 @@ block.admin_edit: title: 'Configure block' route_name: block.admin_edit - tab_root_id: block.admin_edit + base_route: block.admin_edit # Per theme block layout pages. block.admin_display: title: 'Block Layout' route_name: block.admin_display - tab_root_id: block.admin_display + base_route: block.admin_display block.admin_display_theme: title: 'Block Layout' route_name: block.admin_display_theme - tab_root_id: block.admin_display - tab_parent_id: block.admin_display + parent_id: block.admin_display derivative: 'Drupal\block\Plugin\Derivative\ThemeLocalTask' diff --git a/core/modules/block/custom_block/custom_block.local_tasks.yml b/core/modules/block/custom_block/custom_block.local_tasks.yml index 9bee9a4c64fcc519a3d136e853749d8ad9a88c1d..041abb76a44ad1f6a9bd318e24b3f478cb46a125 100644 --- a/core/modules/block/custom_block/custom_block.local_tasks.yml +++ b/core/modules/block/custom_block/custom_block.local_tasks.yml @@ -1,29 +1,27 @@ custom_block.list: title: 'Custom block library' route_name: custom_block.list - tab_root_id: block.admin_display + base_route: block.admin_display custom_block.list_sub: title: Blocks route_name: custom_block.list - tab_root_id: block.admin_display - tab_parent_id: custom_block.list + parent_id: custom_block.list custom_block.type_list: title: Types route_name: custom_block.type_list - tab_root_id: block.admin_display - tab_parent_id: custom_block.list + parent_id: custom_block.list custom_block.edit: title: Edit route_name: custom_block.edit - tab_root_id: custom_block.edit + base_route: custom_block.edit custom_block.delete: title: Delete route_name: custom_block.delete - tab_root_id: custom_block.edit + base_route: custom_block.edit # Default tab for custom block type editing. custom_block.type_edit: title: 'Edit' route_name: custom_block.type_edit - tab_root_id: custom_block.type_edit + base_route: custom_block.type_edit 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 77a223570f64101c3e11312a3255283ab2825eff..99888139659d86b7aed47b8799d466762ad5f424 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/book/book.local_tasks.yml b/core/modules/book/book.local_tasks.yml index f0f84644712f41eefc8f3cd0c3f3ac6f678e4ab1..796c5fda0f63c10d0b94d891421014e70f15d4d8 100644 --- a/core/modules/book/book.local_tasks.yml +++ b/core/modules/book/book.local_tasks.yml @@ -1,15 +1,15 @@ book.admin: route_name: book.admin title: 'List' - tab_root_id: book.admin + base_route: book.admin book.settings: route_name: book.settings title: 'Settings' - tab_root_id: book.admin + base_route: book.admin weight: 100 book.outline: route_name: book.outline - tab_root_id: node.view + base_route: node.view title: Outline weight: 2 diff --git a/core/modules/comment/comment.local_tasks.yml b/core/modules/comment/comment.local_tasks.yml index baba52cc68df2b7909f3268d10ebfd66b5daaa00..091321bf945551432bfadd3c3d7c88b7e36f0e4c 100644 --- a/core/modules/comment/comment.local_tasks.yml +++ b/core/modules/comment/comment.local_tasks.yml @@ -1,33 +1,31 @@ comment.permalink_tab: route_name: comment.permalink title: 'View comment' - tab_root_id: comment.permalink_tab + base_route: comment.permalink comment.edit_page_tab: route_name: comment.edit_page title: 'Edit' - tab_root_id: comment.permalink_tab + base_route: comment.permalink weight: 0 comment.confirm_delete_tab: route_name: comment.confirm_delete title: 'Delete' - tab_root_id: comment.permalink_tab + base_route: comment.permalink weight: 10 comment.admin: title: Comments route_name: comment.admin - tab_root_id: node.content_overview + base_route: node.content_overview comment.admin_new: title: 'Published comments' route_name: comment.admin - tab_root_id: node.content_overview - tab_parent_id: comment.admin + parent_id: comment.admin comment.admin_approval: title: 'Unapproved comments' route_name: comment.admin_approval class: Drupal\comment\Plugin\Menu\LocalTask\UnapprovedComments - tab_root_id: node.content_overview - tab_parent_id: comment.admin + parent_id: comment.admin weight: 1 diff --git a/core/modules/config/config.local_tasks.yml b/core/modules/config/config.local_tasks.yml index b24f53b2953429edfaee8d8b18be563bae3699b0..5a894f03f1a36c6c9e6577c4e096f7c5f672756f 100644 --- a/core/modules/config/config.local_tasks.yml +++ b/core/modules/config/config.local_tasks.yml @@ -1,38 +1,34 @@ config.sync: route_name: config.sync - tab_root_id: config.sync + base_route: config.sync title: 'Synchronize' config.full: route_name: config.import_full title: 'Full Import/Export' - tab_root_id: config.sync + base_route: config.sync config.single: route_name: config.import_single title: 'Single Import/Export' - tab_root_id: config.sync + base_route: config.sync config.export_full: route_name: config.export_full title: Export - tab_root_id: config.sync - tab_parent_id: config.full + parent_id: config.full config.import_full: route_name: config.import_full title: Import - tab_root_id: config.sync - tab_parent_id: config.full + parent_id: config.full config.export_single: route_name: config.export_single title: Export - tab_root_id: config.sync - tab_parent_id: config.single + parent_id: config.single config.import_single: route_name: config.import_single title: Import - tab_root_id: config.sync - tab_parent_id: config.single + parent_id: config.single diff --git a/core/modules/config/tests/config_test/config_test.local_tasks.yml b/core/modules/config/tests/config_test/config_test.local_tasks.yml index 989f131a1713dd93eb4095d823e99fa4c3e3ddc6..d05ae41da649a5d1b013cf7be56339ceb32a8a1e 100644 --- a/core/modules/config/tests/config_test/config_test.local_tasks.yml +++ b/core/modules/config/tests/config_test/config_test.local_tasks.yml @@ -1,4 +1,4 @@ config_test.entity_tab: route_name: config_test.entity title: 'Edit' - tab_root_id: config_test.entity_tab + base_route: config_test.entity diff --git a/core/modules/config_translation/config_translation.module b/core/modules/config_translation/config_translation.module index 0fc117024a75a7da02f991501d3672bf7ebde928..fa3809f42ee44bf288756c1763b7103fdab64221 100644 --- a/core/modules/config_translation/config_translation.module +++ b/core/modules/config_translation/config_translation.module @@ -175,12 +175,3 @@ function config_translation_library_info() { ); return $libraries; } - -/** - * Implements hook_local_tasks_alter(). - */ -function config_translation_local_tasks_alter(&$local_tasks) { - // Alters in tab_root_ids onto the config translation local tasks. - $derivative = ConfigTranslationLocalTasks::create(\Drupal::getContainer(), 'config_translation.local_tasks'); - $derivative->alterLocalTasks($local_tasks); -} diff --git a/core/modules/config_translation/lib/Drupal/config_translation/Plugin/Derivative/ConfigTranslationLocalTasks.php b/core/modules/config_translation/lib/Drupal/config_translation/Plugin/Derivative/ConfigTranslationLocalTasks.php index c7ccba349a5c208b0ab63d581bd44bceec821c1f..20b9c795fc94f6e9f0a975ca6d7a1f6ceea273be 100644 --- a/core/modules/config_translation/lib/Drupal/config_translation/Plugin/Derivative/ConfigTranslationLocalTasks.php +++ b/core/modules/config_translation/lib/Drupal/config_translation/Plugin/Derivative/ConfigTranslationLocalTasks.php @@ -8,14 +8,14 @@ namespace Drupal\config_translation\Plugin\Derivative; use Drupal\config_translation\ConfigMapperManagerInterface; -use Drupal\Core\Menu\LocalTaskDerivativeBase; +use Drupal\Component\Plugin\Derivative\DerivativeBase; use Drupal\Core\Plugin\Discovery\ContainerDerivativeInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** * Provides dynamic local tasks for config translation. */ -class ConfigTranslationLocalTasks extends LocalTaskDerivativeBase implements ContainerDerivativeInterface { +class ConfigTranslationLocalTasks extends DerivativeBase implements ContainerDerivativeInterface { /** * The mapper plugin discovery service. @@ -62,32 +62,16 @@ public function getDerivativeDefinitions(array $base_plugin_definition) { foreach ($mappers as $plugin_id => $mapper) { /** @var \Drupal\config_translation\ConfigMapperInterface $mapper */ $route_name = $mapper->getOverviewRouteName(); - $this->derivatives[$route_name] = $base_plugin_definition; - $this->derivatives[$route_name]['config_translation_plugin_id'] = $plugin_id; - $this->derivatives[$route_name]['class'] = '\Drupal\config_translation\Plugin\Menu\LocalTask\ConfigTranslationLocalTask'; - $this->derivatives[$route_name]['route_name'] = $route_name; - } - return parent::getDerivativeDefinitions($base_plugin_definition); - } - - /** - * Alters the local tasks to find the proper tab_root_id for each task. - */ - public function alterLocalTasks(array &$local_tasks) { - $mappers = $this->mapperManager->getMappers(); - foreach ($mappers as $mapper) { - /** @var \Drupal\config_translation\ConfigMapperInterface $mapper */ - $route_name = $mapper->getOverviewRouteName(); - $translation_tab = $this->basePluginId . ':' . $route_name; - $tab_root_id = $this->getPluginIdFromRoute($mapper->getBaseRouteName(), $local_tasks); - if (!empty($tab_root_id)) { - $local_tasks[$translation_tab]['tab_root_id'] = $tab_root_id; - } - else { - unset($local_tasks[$translation_tab]); + $base_route = $mapper->getBaseRouteName(); + if (!empty($base_route)) { + $this->derivatives[$route_name] = $base_plugin_definition; + $this->derivatives[$route_name]['config_translation_plugin_id'] = $plugin_id; + $this->derivatives[$route_name]['class'] = '\Drupal\config_translation\Plugin\Menu\LocalTask\ConfigTranslationLocalTask'; + $this->derivatives[$route_name]['route_name'] = $route_name; + $this->derivatives[$route_name]['base_route'] = $base_route; } } + return parent::getDerivativeDefinitions($base_plugin_definition); } - } diff --git a/core/modules/contact/contact.local_tasks.yml b/core/modules/contact/contact.local_tasks.yml index 2eee1ee66a100f9eaca4824fbeb11db5546b96c7..e613a8395ee30f6019eecdb6255c40c6e946ce82 100644 --- a/core/modules/contact/contact.local_tasks.yml +++ b/core/modules/contact/contact.local_tasks.yml @@ -1,10 +1,10 @@ contact.category_edit: title: 'Edit' route_name: contact.category_edit - tab_root_id: contact.category_edit + base_route: contact.category_edit contact.personal_page: title: 'Contact' route_name: contact.personal_page weight: 2 - tab_root_id: user.view + base_route: user.view diff --git a/core/modules/content_translation/content_translation.module b/core/modules/content_translation/content_translation.module index 0d476cbb885a9461608d39ca26f25ef110ccbf11..5a5c15ecf6f5d8942e21cf6cc5da52ac396c20be 100644 --- a/core/modules/content_translation/content_translation.module +++ b/core/modules/content_translation/content_translation.module @@ -261,15 +261,6 @@ function content_translation_menu_alter(array &$items) { } } -/** - * Implements hook_local_tasks_alter(). - */ -function content_translation_local_tasks_alter(&$local_tasks) { - // Alters in tab_root_id onto the content translation local task. - $derivative = ContentTranslationLocalTasks::create(\Drupal::getContainer(), 'content_translation.local_tasks'); - $derivative->alterLocalTasks($local_tasks); -} - /** * Convert an entity canonical link to a router path. * diff --git a/core/modules/content_translation/lib/Drupal/content_translation/Plugin/Derivative/ContentTranslationLocalTasks.php b/core/modules/content_translation/lib/Drupal/content_translation/Plugin/Derivative/ContentTranslationLocalTasks.php index e906fd962f8e395805262099951e2ed8cfa59f7e..ccc726c387534c41ee6df826db3c462a0a0074fa 100644 --- a/core/modules/content_translation/lib/Drupal/content_translation/Plugin/Derivative/ContentTranslationLocalTasks.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/Plugin/Derivative/ContentTranslationLocalTasks.php @@ -8,14 +8,14 @@ namespace Drupal\content_translation\Plugin\Derivative; use Drupal\content_translation\ContentTranslationManagerInterface; -use Drupal\Core\Menu\LocalTaskDerivativeBase; +use Drupal\Component\Plugin\Derivative\DerivativeBase; use Drupal\Core\Plugin\Discovery\ContainerDerivativeInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** * Provides dynamic local tasks for content translation. */ -class ContentTranslationLocalTasks extends LocalTaskDerivativeBase implements ContainerDerivativeInterface { +class ContentTranslationLocalTasks extends DerivativeBase implements ContainerDerivativeInterface { /** * The base plugin ID @@ -67,25 +67,10 @@ public function getDerivativeDefinitions(array $base_plugin_definition) { 'entity_type' => $entity_type, 'title' => 'Translate', 'route_name' => $translation_route_name, + 'base_route' => $entity_info['links']['canonical'], ) + $base_plugin_definition; } return parent::getDerivativeDefinitions($base_plugin_definition); } - /** - * Alters the local tasks to find the proper tab_root_id for each task. - */ - public function alterLocalTasks(array &$local_tasks) { - foreach ($this->contentTranslationManager->getSupportedEntityTypes() as $entity_info) { - // Find the route name for the entity page. - $entity_route_name = $entity_info['links']['canonical']; - - // Find the route name for the translation overview. - $translation_route_name = $entity_info['links']['drupal:content-translation-overview']; - $translation_tab = $this->basePluginId . ':' . $translation_route_name; - - $local_tasks[$translation_tab]['tab_root_id'] = $this->getPluginIdFromRoute($entity_route_name, $local_tasks); - } - } - } diff --git a/core/modules/content_translation/tests/Drupal/content_translation/Tests/Menu/ContentTranslationLocalTasksTest.php b/core/modules/content_translation/tests/Drupal/content_translation/Tests/Menu/ContentTranslationLocalTasksTest.php index e0b164bbc54d5fcec76975fd7d2a24cee75ec607..d1ed5f2709f0b9d4befa99036a1583ffb699c4e9 100644 --- a/core/modules/content_translation/tests/Drupal/content_translation/Tests/Menu/ContentTranslationLocalTasksTest.php +++ b/core/modules/content_translation/tests/Drupal/content_translation/Tests/Menu/ContentTranslationLocalTasksTest.php @@ -8,7 +8,6 @@ namespace Drupal\content_translation\Tests\Menu; use Drupal\Tests\Core\Menu\LocalTaskIntegrationTest; -use Drupal\content_translation\Plugin\Derivative\ContentTranslationLocalTasks;; /** * Tests existence of block local tasks. @@ -48,24 +47,6 @@ public function setUp() { \Drupal::getContainer()->set('content_translation.manager', $content_translation_manager); } - /** - * {@inheritdoc} - */ - protected function getLocalTaskManager($modules, $route_name, $route_params) { - $manager = parent::getLocalTaskManager($modules, $route_name, $route_params); - - // Duplicate content_translation_local_tasks_alter()'s code here to avoid - // having to load the .module file. - $this->moduleHandler->expects($this->once()) - ->method('alter') - ->will($this->returnCallback(function ($hook, &$local_tasks) { - // Alters in tab_root_id onto the content translation local task. - $derivative = ContentTranslationLocalTasks::create(\Drupal::getContainer(), 'content_translation.local_tasks'); - $derivative->alterLocalTasks($local_tasks); - })); - return $manager; - } - /** * Tests the block admin display local tasks. * diff --git a/core/modules/entity/entity.local_tasks.yml b/core/modules/entity/entity.local_tasks.yml index 7c1778dd692755685aa7c3ff5f608283933a0b50..409b7725bf9f51c1ce2b8ff031969e54be3c4e3b 100644 --- a/core/modules/entity/entity.local_tasks.yml +++ b/core/modules/entity/entity.local_tasks.yml @@ -1,19 +1,19 @@ entity.view_mode_edit: title: 'Edit' route_name: entity.view_mode_edit - tab_root_id: entity.view_mode_edit + base_route: entity.view_mode_edit entity.form_mode_edit: title: 'Edit' route_name: entity.form_mode_edit - tab_root_id: entity.form_mode_edit + base_route: entity.form_mode_edit entity.view_mode_list: title: List route_name: entity.view_mode_list - tab_root_id: entity.view_mode_list + base_route: entity.view_mode_list entity.form_mode_list: title: List route_name: entity.form_mode_list - tab_root_id: entity.form_mode_list + base_route: entity.form_mode_list diff --git a/core/modules/field_ui/field_ui.local_tasks.yml b/core/modules/field_ui/field_ui.local_tasks.yml index 1330c2dc07c8fa2c950e46d35750eb6092467d72..d724933f399568ea41cc131ae9d11154f7d9ad31 100644 --- a/core/modules/field_ui/field_ui.local_tasks.yml +++ b/core/modules/field_ui/field_ui.local_tasks.yml @@ -1,7 +1,7 @@ field_ui.list: title: Entities route_name: field_ui.list - tab_root_id: field_ui.list + base_route: field_ui.list field_ui.fields: class: \Drupal\Core\Menu\LocalTaskDefault derivative: \Drupal\field_ui\Plugin\Derivative\FieldUiLocalTask diff --git a/core/modules/field_ui/lib/Drupal/field_ui/Plugin/Derivative/FieldUiLocalTask.php b/core/modules/field_ui/lib/Drupal/field_ui/Plugin/Derivative/FieldUiLocalTask.php index 9a7c20884805041740002628bd0830131b0d351f..fea754f04fe9b64ec607479d3ac1548e4b1dfa86 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/Plugin/Derivative/FieldUiLocalTask.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/Plugin/Derivative/FieldUiLocalTask.php @@ -8,7 +8,7 @@ namespace Drupal\field_ui\Plugin\Derivative; use Drupal\Core\Entity\EntityManagerInterface; -use Drupal\Core\Menu\LocalTaskDerivativeBase; +use Drupal\Component\Plugin\Derivative\DerivativeBase; use Drupal\Core\Plugin\Discovery\ContainerDerivativeInterface; use Drupal\Core\Routing\RouteProviderInterface; use Drupal\Core\StringTranslation\TranslationInterface; @@ -17,7 +17,7 @@ /** * Provides local task definitions for all entity bundles. */ -class FieldUiLocalTask extends LocalTaskDerivativeBase implements ContainerDerivativeInterface { +class FieldUiLocalTask extends DerivativeBase implements ContainerDerivativeInterface { /** * The route provider. @@ -79,7 +79,7 @@ public function getDerivativeDefinitions(array $base_plugin_definition) { 'route_name' => "field_ui.overview_$entity_type", 'weight' => 1, 'title' => $this->t('Manage fields'), - 'tab_root_id' => "field_ui.fields:overview_$entity_type", + 'base_route' => "field_ui.overview_$entity_type", ); // 'Manage form display' tab. @@ -87,7 +87,7 @@ public function getDerivativeDefinitions(array $base_plugin_definition) { 'route_name' => "field_ui.form_display_overview_$entity_type", 'weight' => 2, 'title' => $this->t('Manage form display'), - 'tab_root_id' => "field_ui.fields:overview_$entity_type", + 'base_route' => "field_ui.overview_$entity_type", ); // 'Manage display' tab. @@ -95,21 +95,21 @@ public function getDerivativeDefinitions(array $base_plugin_definition) { 'route_name' => "field_ui.display_overview_$entity_type", 'weight' => 3, 'title' => $this->t('Manage display'), - 'tab_root_id' => "field_ui.fields:overview_$entity_type", + 'base_route' => "field_ui.overview_$entity_type", ); // Field instance edit tab. $this->derivatives["instance_edit_$entity_type"] = array( 'route_name' => "field_ui.instance_edit_$entity_type", 'title' => $this->t('Edit'), - 'tab_root_id' => "field_ui.fields:instance_edit_$entity_type", + 'base_route' => "field_ui.instance_edit_$entity_type", ); // Field settings tab. $this->derivatives["field_edit_$entity_type"] = array( 'route_name' => "field_ui.field_edit_$entity_type", 'title' => $this->t('Field settings'), - 'tab_root_id' => "field_ui.fields:instance_edit_$entity_type", + 'base_route' => "field_ui.instance_edit_$entity_type", ); // View and form modes secondary tabs. @@ -122,14 +122,12 @@ public function getDerivativeDefinitions(array $base_plugin_definition) { $this->derivatives['field_form_display_default_' . $entity_type] = array( 'title' => 'Default', 'route_name' => "field_ui.form_display_overview_$entity_type", - 'tab_root_id' => "field_ui.fields:overview_$entity_type", - 'tab_parent_id' => "field_ui.fields:form_display_overview_$entity_type", + 'parent_id' => "field_ui.fields:form_display_overview_$entity_type", ); $this->derivatives['field_display_default_' . $entity_type] = array( 'title' => 'Default', 'route_name' => "field_ui.display_overview_$entity_type", - 'tab_root_id' => "field_ui.fields:overview_$entity_type", - 'tab_parent_id' => "field_ui.fields:display_overview_$entity_type", + 'parent_id' => "field_ui.fields:display_overview_$entity_type", ); // One local task for each form mode. @@ -141,8 +139,7 @@ public function getDerivativeDefinitions(array $base_plugin_definition) { 'route_parameters' => array( 'form_mode_name' => $form_mode, ), - 'tab_root_id' => "field_ui.fields:overview_$entity_type", - 'tab_parent_id' => "field_ui.fields:form_display_overview_$entity_type", + 'parent_id' => "field_ui.fields:form_display_overview_$entity_type", 'weight' => $weight++, ); } @@ -156,8 +153,7 @@ public function getDerivativeDefinitions(array $base_plugin_definition) { 'route_parameters' => array( 'view_mode_name' => $view_mode, ), - 'tab_root_id' => "field_ui.fields:overview_$entity_type", - 'tab_parent_id' => "field_ui.fields:display_overview_$entity_type", + 'parent_id' => "field_ui.fields:display_overview_$entity_type", 'weight' => $weight++, ); } @@ -172,7 +168,7 @@ public function getDerivativeDefinitions(array $base_plugin_definition) { } /** - * Alters the tab_root_id definition for field_ui local tasks. + * Alters the base_route definition for field_ui local tasks. * * @param array $local_tasks * An array of local tasks plugin definitions, keyed by plugin ID. @@ -180,20 +176,18 @@ public function getDerivativeDefinitions(array $base_plugin_definition) { public function alterLocalTasks(&$local_tasks) { foreach ($this->entityManager->getDefinitions() as $entity_type => $entity_info) { if ($entity_info['fieldable'] && isset($entity_info['links']['admin-form'])) { - if ($parent_task = $this->getPluginIdFromRoute($entity_info['links']['admin-form'], $local_tasks)) { - $local_tasks["field_ui.fields:overview_$entity_type"]['tab_root_id'] = $parent_task; - $local_tasks["field_ui.fields:form_display_overview_$entity_type"]['tab_root_id'] = $parent_task; - $local_tasks["field_ui.fields:display_overview_$entity_type"]['tab_root_id'] = $parent_task; - $local_tasks["field_ui.fields:field_form_display_default_$entity_type"]['tab_root_id'] = $parent_task; - $local_tasks["field_ui.fields:field_display_default_$entity_type"]['tab_root_id'] = $parent_task; - - foreach (entity_get_form_modes($entity_type) as $form_mode => $form_mode_info) { - $local_tasks['field_ui.fields:field_form_display_' . $form_mode . '_' . $entity_type]['tab_root_id'] = $parent_task; - } - - foreach (entity_get_view_modes($entity_type) as $view_mode => $form_mode_info) { - $local_tasks['field_ui.fields:field_display_' . $view_mode . '_' . $entity_type]['tab_root_id'] = $parent_task; - } + $local_tasks["field_ui.fields:overview_$entity_type"]['base_route'] = $entity_info['links']['admin-form']; + $local_tasks["field_ui.fields:form_display_overview_$entity_type"]['base_route'] = $entity_info['links']['admin-form']; + $local_tasks["field_ui.fields:display_overview_$entity_type"]['base_route'] = $entity_info['links']['admin-form']; + $local_tasks["field_ui.fields:field_form_display_default_$entity_type"]['base_route'] = $entity_info['links']['admin-form']; + $local_tasks["field_ui.fields:field_display_default_$entity_type"]['base_route'] = $entity_info['links']['admin-form']; + + foreach (entity_get_form_modes($entity_type) as $form_mode => $form_mode_info) { + $local_tasks['field_ui.fields:field_form_display_' . $form_mode . '_' . $entity_type]['base_route'] = $entity_info['links']['admin-form']; + } + + foreach (entity_get_view_modes($entity_type) as $view_mode => $form_mode_info) { + $local_tasks['field_ui.fields:field_display_' . $view_mode . '_' . $entity_type]['base_route'] = $entity_info['links']['admin-form']; } } } diff --git a/core/modules/filter/filter.local_tasks.yml b/core/modules/filter/filter.local_tasks.yml index 56cbb878ab7493ad293ab41667a099177f96746d..166132b5eee7baf9d6e7132a0fc5ce49128923f2 100644 --- a/core/modules/filter/filter.local_tasks.yml +++ b/core/modules/filter/filter.local_tasks.yml @@ -1,10 +1,10 @@ filter.format_edit_tab: route_name: filter.format_edit title: 'Configure' - tab_root_id: filter.format_edit_tab + base_route: filter.format_edit weight: -10 filter.admin_overview: title: List route_name: filter.admin_overview - tab_root_id: filter.admin_overview + base_route: filter.admin_overview diff --git a/core/modules/forum/forum.local_tasks.yml b/core/modules/forum/forum.local_tasks.yml index 4cd9dcbde440e8f00e5533b30b215fce2480c81b..10a8f41d87ea53f001f5dd6a443abe60bfb782a9 100644 --- a/core/modules/forum/forum.local_tasks.yml +++ b/core/modules/forum/forum.local_tasks.yml @@ -1,9 +1,9 @@ forum.overview: route_name: forum.overview - tab_root_id: forum.overview + base_route: forum.overview title: List forum.settings: route_name: forum.settings - tab_root_id: forum.overview + base_route: forum.overview title: Settings weight: 100 diff --git a/core/modules/image/image.local_tasks.yml b/core/modules/image/image.local_tasks.yml index 3bff78302dccda7fa0708ed876ea97419b5351be..c851144e66753d92b4b98362ee187674c3fa9151 100644 --- a/core/modules/image/image.local_tasks.yml +++ b/core/modules/image/image.local_tasks.yml @@ -1,9 +1,9 @@ image.style_edit: title: 'Edit' route_name: image.style_edit - tab_root_id: image.style_edit + base_route: image.style_edit image.style_list: title: List route_name: image.style_list - tab_root_id: image.style_list + base_route: image.style_list diff --git a/core/modules/language/language.local_tasks.yml b/core/modules/language/language.local_tasks.yml index fc5f30ce97fab9d222ad92f7e902b78377880470..da3a945b1bd0910a32d63f0210186c41fde3518c 100644 --- a/core/modules/language/language.local_tasks.yml +++ b/core/modules/language/language.local_tasks.yml @@ -1,13 +1,13 @@ language.admin_overview: title: 'List' route_name: language.admin_overview - tab_root_id: language.admin_overview + base_route: language.admin_overview language.negotiation: title: 'Detection and selection' route_name: language.negotiation - tab_root_id: language.admin_overview + base_route: language.admin_overview language.edit: title: 'Edit' route_name: language.edit - tab_root_id: language.edit + base_route: language.edit diff --git a/core/modules/locale/locale.local_tasks.yml b/core/modules/locale/locale.local_tasks.yml index ade24ed23a9da71ac312660ce9047ee2fa0a6362..7644f3dbe452e4f33dd164e2d45057cbbaba9cb7 100644 --- a/core/modules/locale/locale.local_tasks.yml +++ b/core/modules/locale/locale.local_tasks.yml @@ -1,22 +1,22 @@ locale.translate_page: route_name: locale.translate_page - tab_root_id: locale.translate_page + base_route: locale.translate_page title: Translate locale.translate_import: route_name: locale.translate_import - tab_root_id: locale.translate_page + base_route: locale.translate_page title: Import weight: 20 locale.translate_export: route_name: locale.translate_export - tab_root_id: locale.translate_page + base_route: locale.translate_page title: Export weight: 30 locale.settings: route_name: locale.settings - tab_root_id: locale.translate_page + base_route: locale.translate_page title: Settings weight: 100 diff --git a/core/modules/menu/menu.local_tasks.yml b/core/modules/menu/menu.local_tasks.yml index bcf4de85ccb90bc5c8ed1f9bb540e8cc77d0613e..038487cda32e4c57d9b283ddf6c090f87dbed76e 100644 --- a/core/modules/menu/menu.local_tasks.yml +++ b/core/modules/menu/menu.local_tasks.yml @@ -1,15 +1,15 @@ menu.menu_edit: title: 'Edit menu' route_name: menu.menu_edit - tab_root_id: menu.menu_edit + base_route: menu.menu_edit menu.overview_page: title: 'List' route_name: menu.overview_page - tab_root_id: menu.overview_page + base_route: menu.overview_page menu.settings: title: 'Settings' route_name: menu.settings - tab_root_id: menu.overview_page + base_route: menu.overview_page weight: 100 diff --git a/core/modules/node/node.local_tasks.yml b/core/modules/node/node.local_tasks.yml index 8be7fa63c0e0fbc65b3c2f4592a15d91d994d232..d3026e117c66681e3896a224646763f5537f420f 100644 --- a/core/modules/node/node.local_tasks.yml +++ b/core/modules/node/node.local_tasks.yml @@ -1,30 +1,30 @@ node.view: route_name: node.view - tab_root_id: node.view + base_route: node.view title: 'View' node.page_edit: route_name: node.page_edit - tab_root_id: node.view + base_route: node.view title: Edit node.delete_confirm: route_name: node.delete_confirm - tab_root_id: node.view + base_route: node.view title: Delete weight: 10 node.content_overview: title: Content route_name: node.content_overview - tab_root_id: node.content_overview + base_route: node.content_overview node.revision_overview: route_name: node.revision_overview - tab_root_id: node.view + base_route: node.view title: 'Revisions' weight: 20 node.type_edit: title: 'Edit' route_name: node.type_edit - tab_root_id: node.type_edit + base_route: node.type_edit node.overview_types: title: List route_name: node.overview_types - tab_root_id: node.overview_types + base_route: node.overview_types diff --git a/core/modules/path/path.local_tasks.yml b/core/modules/path/path.local_tasks.yml index 84e74d20c4da3941b486beab769dfe1e457ff622..bc59857a4ab41f3ee2e16a93fa888bdd0b2aebe0 100644 --- a/core/modules/path/path.local_tasks.yml +++ b/core/modules/path/path.local_tasks.yml @@ -1,4 +1,4 @@ path.admin_overview: title: List route_name: path.admin_overview - tab_root_id: path.admin_overview + base_route: path.admin_overview diff --git a/core/modules/picture/picture.local_tasks.yml b/core/modules/picture/picture.local_tasks.yml index 29b84461c9434dd02f1bcee1ea08920324aa109e..adf9995535d7a229d6249b8a5a83d4cf9c17c721 100644 --- a/core/modules/picture/picture.local_tasks.yml +++ b/core/modules/picture/picture.local_tasks.yml @@ -1,5 +1,5 @@ picture.mapping_page_edit: title: Edit route_name: picture.mapping_page_edit - tab_root_id: picture.mapping_page_edit + base_route: picture.mapping_page_edit weight: -10 diff --git a/core/modules/search/lib/Drupal/search/Plugin/Derivative/SearchLocalTask.php b/core/modules/search/lib/Drupal/search/Plugin/Derivative/SearchLocalTask.php index f18e699cd474d5fc9c91a0d44044f35c38a4fd6f..5c418bc0a94151c6b2e1f8ef4353a55e0034c846 100644 --- a/core/modules/search/lib/Drupal/search/Plugin/Derivative/SearchLocalTask.php +++ b/core/modules/search/lib/Drupal/search/Plugin/Derivative/SearchLocalTask.php @@ -26,7 +26,7 @@ public function getDerivativeDefinitions(array $base_plugin_definition) { $this->derivatives[$plugin_id] = array( 'title' => $search_info['title'], 'route_name' => 'search.view_' . $plugin_id, - 'tab_root_id' => 'search.plugins:' . $default_info['id'], + 'base_route' => 'search.view_' . $default_info['id'], ); if ($plugin_id == $default_info['id']) { $this->derivatives[$plugin_id]['weight'] = -10; diff --git a/core/modules/shortcut/shortcut.local_tasks.yml b/core/modules/shortcut/shortcut.local_tasks.yml index e25ecd7beceffa7097565d997e27feed872fe5ae..486d58470520e1863b98c378e13dc3bdc9161a2b 100644 --- a/core/modules/shortcut/shortcut.local_tasks.yml +++ b/core/modules/shortcut/shortcut.local_tasks.yml @@ -1,14 +1,14 @@ shortcut.overview: route_name: shortcut.overview - tab_root_id: user.view + base_route: user.view title: 'Shortcuts' shortcut.set_customize: title: 'List links' route_name: shortcut.set_customize - tab_root_id: shortcut.set_customize + base_route: shortcut.set_customize shortcut.set_edit: title: 'Edit set name' route_name: shortcut.set_edit - tab_root_id: shortcut.set_customize + base_route: shortcut.set_customize weight: 10 diff --git a/core/modules/simpletest/simpletest.local_tasks.yml b/core/modules/simpletest/simpletest.local_tasks.yml index b6eea385f7fbcbfe4104be1a346c6b477c0e92df..4f1fd00d0fab3b076567cce6db3bd66098ffee08 100644 --- a/core/modules/simpletest/simpletest.local_tasks.yml +++ b/core/modules/simpletest/simpletest.local_tasks.yml @@ -1,9 +1,9 @@ simpletest.test_form: title: List route_name: simpletest.test_form - tab_root_id: simpletest.test_form + base_route: simpletest.test_form simpletest.settings: title: Settings route_name: simpletest.settings - tab_root_id: simpletest.test_form + base_route: simpletest.test_form weight: 100 diff --git a/core/modules/system/system.local_tasks.yml b/core/modules/system/system.local_tasks.yml index 0ea4ef3c8cea9cdf375a8fa2f667c5b1e3b3df21..4d597ee708a91c3124dd64fc6c32d2ff4f96e81d 100644 --- a/core/modules/system/system.local_tasks.yml +++ b/core/modules/system/system.local_tasks.yml @@ -1,67 +1,65 @@ system.rss_feeds_settings_tab: route_name: system.rss_feeds_settings title: Settings - tab_root_id: system.rss_feeds_settings_tab + base_route: system.rss_feeds_settings system.site_maintenance_mode_tab: route_name: system.site_maintenance_mode title: Settings - tab_root_id: system.site_maintenance_mode_tab + base_route: system.site_maintenance_mode system.site_information_settings_tab: route_name: system.site_information_settings title: Settings - tab_root_id: system.site_information_settings_tab + base_route: system.site_information_settings system.themes_page: route_name: system.themes_page title: 'List' - tab_root_id: system.themes_page + base_route: system.themes_page system.theme_settings: route_name: system.theme_settings title: 'Settings' - tab_root_id: system.themes_page + base_route: system.themes_page weight: 100 system.theme_settings_global: route_name: system.theme_settings title: 'Global settings' - tab_root_id: system.themes_page - tab_parent_id: system.theme_settings + parent_id: system.theme_settings weight: -100 system.theme_settings_theme: route_name: system.theme_settings_theme title: 'Theme name' - tab_root_id: system.themes_page - tab_parent_id: system.theme_settings + parent_id: system.theme_settings derivative: Drupal\system\Plugin\Derivative\ThemeLocalTask system.modules_list: route_name: system.modules_list - tab_root_id: system.modules_list + base_route: system.modules_list title: 'List' system.modules_uninstall: route_name: system.modules_uninstall - tab_root_id: system.modules_list + base_route: system.modules_list title: 'Uninstall' weight: 20 system.admin: route_name: system.admin - tab_root_id: system.admin + base_route: system.admin title: 'Tasks' weight: -20 system.admin_index: route_name: system.admin_index - tab_root_id: system.admin + base_route: system.admin title: 'Index' weight: -18 system.date_format_list: route_name: system.date_format_list - tab_root_id: system.date_format_list + base_route: system.date_format_list title: 'List' system.date_format_edit: title: 'Edit' route_name: system.date_format_edit - tab_root_id: system.date_format_edit + base_route: system.date_format_edit diff --git a/core/modules/system/tests/modules/batch_test/batch_test.local_tasks.yml b/core/modules/system/tests/modules/batch_test/batch_test.local_tasks.yml index ea4a6fd141dce9ea070fe1b5658df828e1a47c6c..f2a85251a74a21e1c56d8611a6c7a38bc5944aba 100644 --- a/core/modules/system/tests/modules/batch_test/batch_test.local_tasks.yml +++ b/core/modules/system/tests/modules/batch_test/batch_test.local_tasks.yml @@ -1,46 +1,46 @@ batch_test.test_form: title: Simple route_name: batch_test.test_form - tab_root_id: batch_test.test_form + base_route: batch_test.test_form batch_test.multistep: title: Multistep route_name: batch_test.multistep - tab_root_id: batch_test.test_form + base_route: batch_test.test_form weight: 1 batch_test.chained: title: Chained route_name: batch_test.chained - tab_root_id: batch_test.test_form + base_route: batch_test.test_form weight: 2 batch_test.programmatic: title: Chained route_name: batch_test.programmatic - tab_root_id: batch_test.test_form + base_route: batch_test.test_form weight: 3 batch_test.no_form: title: 'No form' route_name: batch_test.no_form - tab_root_id: batch_test.test_form + base_route: batch_test.test_form weight: 4 batch_test.large_percentage: title: 'Large percentage' route_name: batch_test.large_percentage - tab_root_id: batch_test.test_form + base_route: batch_test.test_form weight: 5 batch_test.nested_programmatic: title: 'Nested programmatic' route_name: batch_test.nested_programmatic - tab_root_id: batch_test.test_form + base_route: batch_test.test_form weight: 6 batch_test.redirect: title: 'Redirect' route_name: batch_test.redirect - tab_root_id: batch_test.test_form + base_route: batch_test.test_form weight: 7 diff --git a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Plugin/Derivative/EntityTestLocalTasks.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Plugin/Derivative/EntityTestLocalTasks.php index c84a2d487a11b4315a2a328adfbe18d33b3a9318..b9bbefb25224c38838f3d5b68f05463c981caa58 100644 --- a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Plugin/Derivative/EntityTestLocalTasks.php +++ b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Plugin/Derivative/EntityTestLocalTasks.php @@ -23,7 +23,7 @@ public function getDerivativeDefinitions(array $base_plugin_definition) { foreach($types as $entity_type) { $this->derivatives[$entity_type] = array(); - $this->derivatives[$entity_type]['tab_root_id'] = "entity_test.local_tasks:$entity_type"; + $this->derivatives[$entity_type]['base_route'] = "entity_test.edit_$entity_type"; $this->derivatives[$entity_type]['route_name'] = "entity_test.edit_$entity_type"; $this->derivatives[$entity_type]['title'] = 'Edit'; } diff --git a/core/modules/system/tests/modules/menu_test/menu_test.local_tasks.yml b/core/modules/system/tests/modules/menu_test/menu_test.local_tasks.yml index 2947bf7dfef312bdd48adedfe76fe2d5069ae9b5..eaa9aae92c9a99fa0923f53fc7b668f29c54ea8f 100644 --- a/core/modules/system/tests/modules/menu_test/menu_test.local_tasks.yml +++ b/core/modules/system/tests/modules/menu_test/menu_test.local_tasks.yml @@ -1,73 +1,69 @@ menu_test.local_task_test_tasks_view: route_name: menu_test.local_task_test_tasks_view title: View - tab_root_id: menu_test.local_task_test_tasks_view + base_route: menu_test.local_task_test_tasks_view menu_test.local_task_test_tasks_edit: route_name: menu_test.local_task_test_tasks_edit title: Edit - tab_root_id: menu_test.local_task_test_tasks_view + base_route: menu_test.local_task_test_tasks_view menu_test.local_task_test_tasks_settings: route_name: menu_test.local_task_test_tasks_settings title: Settings - tab_root_id: menu_test.local_task_test_tasks_view + base_route: menu_test.local_task_test_tasks_view menu_test.local_task_test_tasks_settings_sub1: route_name: menu_test.local_task_test_tasks_settings_sub1 title: sub1 - tab_root_id: menu_test.local_task_test_tasks_view - tab_parent_id: menu_test.local_task_test_tasks_settings + parent_id: menu_test.local_task_test_tasks_settings class: Drupal\menu_test\Plugin\Menu\LocalTask\TestTasksSettingsSub1 weight: -10 menu_test.local_task_test_tasks_settings_sub2: route_name: menu_test.local_task_test_tasks_settings_sub2 title: sub2 - tab_root_id: menu_test.local_task_test_tasks_view - tab_parent_id: menu_test.local_task_test_tasks_settings + parent_id: menu_test.local_task_test_tasks_settings menu_test.local_task_test_tasks_settings_sub3: route_name: menu_test.local_task_test_tasks_settings_sub3 title: sub3 - tab_root_id: menu_test.local_task_test_tasks_view - tab_parent_id: menu_test.local_task_test_tasks_settings + parent_id: menu_test.local_task_test_tasks_settings weight: 20 menu_test.local_task_test_tasks_settings_derived: route_name: menu_test.local_task_test_tasks_settings_derived title: derived - tab_root_id: menu_test.local_task_test_tasks_view - tab_parent_id: menu_test.local_task_test_tasks_settings + parent_id: menu_test.local_task_test_tasks_settings derivative: Drupal\menu_test\Plugin\Derivative\LocalTaskTest weight: 50 menu_test.local_task_test.placeholder_sub1: route_name: menu_test.local_task_test_placeholder_sub1 title: 'placeholder sub1' - tab_root_id: menu_test.local_task_test_placeholder_sub1 + base_route: menu_test.local_task_test_placeholder_sub1 menu_test.local_task_test_placeholder_sub2: route_name: menu_test.local_task_test_placeholder_sub2 title: 'placeholder sub2' - tab_root_id: menu_test.local_task_test_placeholder_sub1 + base_route: menu_test.local_task_test_placeholder_sub1 menu_test.local_task_test.upcasting_sub1: route_name: menu_test.local_task_test_upcasting_sub1 title: 'upcasting sub1' - tab_root_id: menu_test.local_task_test_upcasting_sub1 + base_route: menu_test.local_task_test_upcasting_sub1 menu_test.local_task_test_upcasting_sub2: route_name: menu_test.local_task_test_upcasting_sub2 title: 'upcasting sub2' - tab_root_id: menu_test.local_task_test_upcasting_sub1 + base_route: menu_test.local_task_test_upcasting_sub1 weight: 10 menu_test.tasks_default_tab: route_name: menu_test.tasks_default title: 'View' - tab_root_id: menu_test.tasks_default_tab + base_route: menu_test.tasks_default menu_test.tasks_tasks_tab: route_name: menu_test.tasks_tasks title: 'View' - tab_root_id: menu_test.tasks_tasks_tab + base_route: menu_test.tasks_tasks menu_test.tasks_edit_tab: route_name: menu_test.tasks_edit title: 'Edit' - tab_root_id: menu_test.tasks_tasks_tab + base_route: menu_test.tasks_tasks menu_test.tasks_settings_tab: route_name: menu_test.tasks_settings title: 'Settings' weight: 100 - tab_root_id: menu_test.tasks_tasks_tab + base_route: menu_test.tasks_tasks diff --git a/core/modules/taxonomy/taxonomy.local_tasks.yml b/core/modules/taxonomy/taxonomy.local_tasks.yml index cdcb4eaccf9f76b3507d5ea9b0826ac92e9436d5..461d762bdfa93fe4e9d3bd9724b9bbbe0a7dec71 100644 --- a/core/modules/taxonomy/taxonomy.local_tasks.yml +++ b/core/modules/taxonomy/taxonomy.local_tasks.yml @@ -1,18 +1,18 @@ taxonomy.term_page: title: 'View' route_name: taxonomy.term_page - tab_root_id: taxonomy.term_page + base_route: taxonomy.term_page taxonomy.term_edit: title: 'Edit' route_name: taxonomy.term_edit - tab_root_id: taxonomy.term_page + base_route: taxonomy.term_page taxonomy.overview_terms: title: 'List' route_name: taxonomy.overview_terms - tab_root_id: taxonomy.overview_terms + base_route: taxonomy.overview_terms taxonomy.vocabulary_edit: title: 'Edit' route_name: taxonomy.vocabulary_edit - tab_root_id: taxonomy.overview_terms + base_route: taxonomy.overview_terms diff --git a/core/modules/tracker/tracker.local_tasks.yml b/core/modules/tracker/tracker.local_tasks.yml index 8a0ab779002dafd0cec3c54ea3dafeabc1010f1a..80920382abc97ba58a68b325e01ed12597158409 100644 --- a/core/modules/tracker/tracker.local_tasks.yml +++ b/core/modules/tracker/tracker.local_tasks.yml @@ -1,15 +1,15 @@ tracker.page_tab: route_name: tracker.page title: 'Recent content' - tab_root_id: tracker.page_tab + base_route: tracker.page tracker.users_recent_tab: route_name: tracker.users_recent_content title: 'My recent content' - tab_root_id: tracker.page_tab + base_route: tracker.page class: '\Drupal\tracker\Plugin\Menu\UserTrackerTab' tracker.user_tab: route_name: tracker.user_tab - tab_root_id: user.view + base_route: user.view title: 'Track' diff --git a/core/modules/update/update.local_tasks.yml b/core/modules/update/update.local_tasks.yml index 1281a2750ded91d3423c3ed379d4eb1da709c3b2..e817f3e37c469e3f49c51b8138405f0ff07082ff 100644 --- a/core/modules/update/update.local_tasks.yml +++ b/core/modules/update/update.local_tasks.yml @@ -1,27 +1,26 @@ update.status: route_name: update.status - tab_root_id: system.admin_reports + base_route: system.admin_reports title: List update.settings: route_name: update.settings - tab_root_id: system.admin_reports - tab_parent_id: update.status + parent_id: update.status title: Settings weight: 50 update.report_install: route_name: update.report_install - tab_root_id: system.admin_reports + base_route: system.admin_reports title: Update weight: 10 update.module_install: route_name: update.module_install - tab_root_id: system.modules_list + base_route: system.modules_list title: Update weight: 10 update.theme_install: route_name: update.theme_install - tab_root_id: system.themes_page + base_route: system.themes_page title: Update weight: 10 diff --git a/core/modules/user/user.local_tasks.yml b/core/modules/user/user.local_tasks.yml index a9cff5b00784dc869ee5da4dd608741b6f2b3819..88957e40d85b843afe7d078976e93ec73a52cf76 100644 --- a/core/modules/user/user.local_tasks.yml +++ b/core/modules/user/user.local_tasks.yml @@ -2,54 +2,53 @@ user.role_edit: title: 'Edit' route_name: user.role_edit - tab_root_id: user.role_edit + base_route: user.role_edit user.account_settings_tab: route_name: user.account_settings title: 'Settings' - tab_root_id: user.account_settings_tab + base_route: user.account_settings user.page: route_name: user.page - tab_root_id: user.page + base_route: user.page title: 'Log in' weight: -10 user.register: route_name: user.register - tab_root_id: user.page + base_route: user.page title: 'Create new account' user.pass: route_name: user.pass - tab_root_id: user.page + base_route: user.page title: 'Request new password' # Other authentication methods may add pages below user/login/. user.login: route_name: user.login - tab_root_id: user.page - tab_parent_id: user.page + parent_id: user.page title: 'Username and password' user.view: route_name: user.view - tab_root_id: user.view + base_route: user.view title: View user.edit: route_name: user.edit - tab_root_id: user.view + base_route: user.view title: Edit user.admin_account: title: List route_name: user.admin_account - tab_root_id: user.admin_account + base_route: user.admin_account user.admin_permissions: title: Permissions route_name: user.admin_permissions - tab_root_id: user.admin_account + base_route: user.admin_account user.role_list: title: 'Roles' route_name: user.role_list - tab_root_id: user.admin_account + base_route: user.admin_account weight: 10 diff --git a/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsLocalTask.php b/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsLocalTask.php index e1064529cc8b39dd3208d1109ae6383d9ccb6b5e..dd346c9641bdbec1879c925d760f5193c652e0c2 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsLocalTask.php +++ b/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsLocalTask.php @@ -8,7 +8,7 @@ namespace Drupal\views\Plugin\Derivative; use Drupal\Core\KeyValueStore\StateInterface; -use Drupal\Core\Menu\LocalTaskDerivativeBase; +use Drupal\Component\Plugin\Derivative\DerivativeBase; use Drupal\Core\Plugin\Discovery\ContainerDerivativeInterface; use Drupal\Core\Routing\RouteProviderInterface; use Drupal\views\Views; @@ -17,7 +17,7 @@ /** * Provides local task definitions for all views configured as local tasks. */ -class ViewsLocalTask extends LocalTaskDerivativeBase implements ContainerDerivativeInterface { +class ViewsLocalTask extends DerivativeBase implements ContainerDerivativeInterface { /** * The route provider. @@ -85,9 +85,9 @@ public function getDerivativeDefinitions(array $base_plugin_definition) { 'title' => $menu['title'], ) + $base_plugin_definition; - // Default local tasks have themselves as tab root id. + // Default local tasks have themselves as root tab. if ($menu['type'] == 'default tab') { - $this->derivatives[$plugin_id]['tab_root_id'] = 'views_view:' . $plugin_id; + $this->derivatives[$plugin_id]['base_route'] = $route_name; } } } @@ -95,7 +95,7 @@ public function getDerivativeDefinitions(array $base_plugin_definition) { } /** - * Alters tab_root_id and tab_parent_id into the views local tasks. + * Alters base_route and parent_id into the views local tasks. */ public function alterLocalTasks(&$local_tasks) { $view_route_names = $this->state->get('views.view_route_names'); @@ -107,7 +107,7 @@ public function alterLocalTasks(&$local_tasks) { $executable->setDisplay($display_id); $menu = $executable->display_handler->getOption('menu'); - // We already have set the tab_root_id for default tabs. + // We already have set the base_route for default tabs. if (in_array($menu['type'], array('tab'))) { $plugin_id = 'view.' . $executable->storage->id() . '.' . $display_id; $view_route_name = $view_route_names[$executable->storage->id() . '.' . $display_id]; @@ -128,9 +128,7 @@ public function alterLocalTasks(&$local_tasks) { $pattern = '/' . str_replace('%', '{}', $path); if ($routes = $this->routeProvider->getRoutesByPattern($pattern)) { foreach ($routes->all() as $name => $route) { - if ($parent_task = $this->getPluginIdFromRoute($name, $local_tasks)) { - $local_tasks['views_view:' . $plugin_id]['tab_root_id'] = $parent_task; - } + $local_tasks['views_view:' . $plugin_id]['base_route'] = $name; // Skip after the first found route. break; } diff --git a/core/modules/views/tests/Drupal/views/Tests/Plugin/Derivative/ViewsLocalTaskTest.php b/core/modules/views/tests/Drupal/views/Tests/Plugin/Derivative/ViewsLocalTaskTest.php index 822f60983b58b5eff0e88aad3dce1f2e22d4f944..2850b923d6cd58e01ee65889975ab33d28c8ba0f 100644 --- a/core/modules/views/tests/Drupal/views/Tests/Plugin/Derivative/ViewsLocalTaskTest.php +++ b/core/modules/views/tests/Drupal/views/Tests/Plugin/Derivative/ViewsLocalTaskTest.php @@ -139,7 +139,7 @@ public function testGetDerivativeDefinitionsWithLocalTask() { $this->assertEquals(12, $definitions['view.example_view.page_1']['weight']); $this->assertEquals('Example title', $definitions['view.example_view.page_1']['title']); $this->assertEquals($this->baseDefinition['class'], $definitions['view.example_view.page_1']['class']); - $this->assertTrue(empty($definitions['view.example_view.page_1']['tab_root_id'])); + $this->assertTrue(empty($definitions['view.example_view.page_1']['base_route'])); } /** @@ -226,7 +226,7 @@ public function testGetDerivativeDefinitionsWithDefaultLocalTask() { $this->assertEquals(12, $plugin['weight']); $this->assertEquals('Example title', $plugin['title']); $this->assertEquals($this->baseDefinition['class'], $plugin['class']); - $this->assertEquals('views_view:view.example_view.page_1', $plugin['tab_root_id']); + $this->assertEquals('view.example_view.page_1', $plugin['base_route']); // Setup the prefix of the derivative. $definitions['views_view:view.example_view.page_1'] = $definitions['view.example_view.page_1']; @@ -239,7 +239,7 @@ public function testGetDerivativeDefinitionsWithDefaultLocalTask() { $this->assertEquals(12, $plugin['weight']); $this->assertEquals('Example title', $plugin['title']); $this->assertEquals($this->baseDefinition['class'], $plugin['class']); - $this->assertEquals('views_view:view.example_view.page_1', $plugin['tab_root_id']); + $this->assertEquals('view.example_view.page_1', $plugin['base_route']); } /** @@ -295,7 +295,7 @@ public function testGetDerivativeDefinitionsWithExistingLocalTask() { $definitions['test_route_tab'] = $other_tab = array( 'route_name' => 'test_route', 'title' => 'Test route', - 'tab_root_id' => 'test_route_tab', + 'base_route' => 'test_route', ); $definitions += $this->localTaskDerivative->getDerivativeDefinitions($this->baseDefinition); @@ -315,7 +315,7 @@ public function testGetDerivativeDefinitionsWithExistingLocalTask() { $this->assertEquals(12, $plugin['weight']); $this->assertEquals('Example title', $plugin['title']); $this->assertEquals($this->baseDefinition['class'], $plugin['class']); - $this->assertEquals('test_route_tab', $plugin['tab_root_id']); + $this->assertEquals('test_route', $plugin['base_route']); } } diff --git a/core/modules/views_ui/views_ui.local_tasks.yml b/core/modules/views_ui/views_ui.local_tasks.yml index 028ebc26979860cfaa9e1c8644c7870d215c8d9a..9ef586e0766f782ce4a529a9bb375bb603734147 100644 --- a/core/modules/views_ui/views_ui.local_tasks.yml +++ b/core/modules/views_ui/views_ui.local_tasks.yml @@ -1,32 +1,30 @@ views_ui.settings_tab: route_name: views_ui.settings_basic title: Settings - tab_root_id: views_ui.list_tab + base_route: views_ui.list views_ui.settings_basic_tab: route_name: views_ui.settings_basic title: Basic - tab_root_id: views_ui.list_tab - tab_parent_id: views_ui.settings_tab + parent_id: views_ui.settings_tab views_ui.settings_advanced_tab: route_name: views_ui.settings_advanced title: Advanced - tab_root_id: views_ui.list_tab - tab_parent_id: views_ui.settings_tab + parent_id: views_ui.settings_tab weight: 10 views_ui.list_tab: route_name: views_ui.list title: List - tab_root_id: views_ui.list_tab + base_route: views_ui.list views_ui.reports_fields: route_name: views_ui.reports_fields title: 'Used in views' - tab_root_id: field_ui.list + base_route: field_ui.list views_ui.edit: title: 'Edit' route_name: views_ui.edit - tab_root_id: views_ui.edit + base_route: views_ui.edit diff --git a/core/tests/Drupal/Tests/Core/Menu/LocalTaskDefaultTest.php b/core/tests/Drupal/Tests/Core/Menu/LocalTaskDefaultTest.php index e708c6a9c727e69a3b24b90093761f0fa225ab34..6fe62a1e562ad303df00bddf6a40b60445db145d 100644 --- a/core/tests/Drupal/Tests/Core/Menu/LocalTaskDefaultTest.php +++ b/core/tests/Drupal/Tests/Core/Menu/LocalTaskDefaultTest.php @@ -193,19 +193,21 @@ public function providerTestGetWeight() { return array( // Manually specify a weight, so this is used. array(array('weight' => 314), 'test_id', 314), - // Ensure that a default tab get a lower weight. + // Ensure that a default tab gets a lower weight. array( array( - 'tab_root_id' => 'local_task_default', + 'base_route' => 'local_task_default', + 'route_name' => 'local_task_default', 'id' => 'local_task_default' ), 'local_task_default', -10 ), - // If the root ID is different to the ID of the tab, ignore it. + // If the base route is different from the route of the tab, ignore it. array( array( - 'tab_root_id' => 'local_task_example', + 'base_route' => 'local_task_example', + 'route_name' => 'local_task_other', 'id' => 'local_task_default' ), 'local_task_default', @@ -214,8 +216,9 @@ public function providerTestGetWeight() { // Ensure that a default tab of a derivative gets the default value. array( array( - 'tab_root_id' => 'local_task_derivative_default:example_id', - 'id' => 'local_task_derivative_default' + 'base_route' => 'local_task_example', + 'id' => 'local_task_derivative_default:example_id', + 'route_name' => 'local_task_example', ), 'local_task_derivative_default:example_id', -10, diff --git a/core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php b/core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php index 049e3eebd667746e7ae5f030b6993a51babae0dc..da5f90d6e25022a9bc9cb9d74caf1c455610bff7 100644 --- a/core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php +++ b/core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php @@ -122,13 +122,31 @@ public function testGetLocalTasksForRouteSingleLevelTitle() { $local_tasks = $this->manager->getLocalTasksForRoute('menu_local_task_test_tasks_view'); - $result = array( - 0 => array( - 'menu_local_task_test_tasks_settings' => $mock_plugin, - 'menu_local_task_test_tasks_view' => $mock_plugin, - 'menu_local_task_test_tasks_edit' => $mock_plugin, - ) - ); + $result = $this->getLocalTasksForRouteResult($mock_plugin); + + $this->assertEquals($result, $local_tasks); + } + + /** + * Tests the getLocalTasksForRoute method on a child. + * + * @see \Drupal\system\Plugin\Type\MenuLocalTaskManager::getLocalTasksForRoute() + */ + public function testGetLocalTasksForRouteForChild() { + $definitions = $this->getLocalTaskFixtures(); + + $this->pluginDiscovery->expects($this->once()) + ->method('getDefinitions') + ->will($this->returnValue($definitions)); + + $mock_plugin = $this->getMock('Drupal\Core\Menu\LocalTaskInterface'); + + $this->setupFactory($mock_plugin); + $this->setupLocalTaskManager(); + + $local_tasks = $this->manager->getLocalTasksForRoute('menu_local_task_test_tasks_child1_page'); + + $result = $this->getLocalTasksForRouteResult($mock_plugin); $this->assertEquals($result, $local_tasks); } @@ -266,33 +284,45 @@ protected function setupLocalTaskManager() { protected function getLocalTaskFixtures() { $definitions = array(); $definitions['menu_local_task_test_tasks_settings'] = array( - 'id' => 'menu_local_task_test_tasks_settings', 'route_name' => 'menu_local_task_test_tasks_settings', 'title' => 'Settings', - 'tab_root_id' => 'menu_local_task_test_tasks_view', + 'base_route' => 'menu_local_task_test_tasks_view', ); $definitions['menu_local_task_test_tasks_edit'] = array( - 'id' => 'menu_local_task_test_tasks_edit', 'route_name' => 'menu_local_task_test_tasks_edit', 'title' => 'Settings', - 'tab_root_id' => 'menu_local_task_test_tasks_view', + 'base_route' => 'menu_local_task_test_tasks_view', 'weight' => 20, ); - $definitions['menu_local_task_test_tasks_view'] = array( - 'id' => 'menu_local_task_test_tasks_view', + // Make this ID different from the route name to catch code that + // confuses them. + $definitions['menu_local_task_test_tasks_view.tab'] = array( 'route_name' => 'menu_local_task_test_tasks_view', 'title' => 'Settings', - 'tab_root_id' => 'menu_local_task_test_tasks_view', + 'base_route' => 'menu_local_task_test_tasks_view', ); - // Add the defaults from the LocalTaskManager. + + $definitions['menu_local_task_test_tasks_view_child1'] = array( + 'route_name' => 'menu_local_task_test_tasks_child1_page', + 'title' => 'Settings child #1', + 'parent_id' => 'menu_local_task_test_tasks_view.tab', + ); + $definitions['menu_local_task_test_tasks_view_child2'] = array( + 'route_name' => 'menu_local_task_test_tasks_child2_page', + 'title' => 'Settings child #2', + 'parent_id' => 'menu_local_task_test_tasks_view.tab', + 'base_route' => 'this_should_be_replaced', + ); + // Add the ID and defaults from the LocalTaskManager. foreach ($definitions as $id => &$info) { + $info['id'] = $id; $info += array( 'id' => '', 'route_name' => '', 'route_parameters' => array(), 'title' => '', - 'tab_root_id' => '', - 'tab_parent_id' => NULL, + 'base_route' => '', + 'parent_id' => NULL, 'weight' => 0, 'options' => array(), 'class' => 'Drupal\Core\Menu\LocalTaskDefault', @@ -308,11 +338,10 @@ protected function getLocalTaskFixtures() { * The mock plugin. */ protected function setupFactory($mock_plugin) { - $map = array( - array('menu_local_task_test_tasks_settings', array(), $mock_plugin), - array('menu_local_task_test_tasks_edit', array(), $mock_plugin), - array('menu_local_task_test_tasks_view', array(), $mock_plugin), - ); + $map = array(); + foreach ($this->getLocalTaskFixtures() as $info) { + $map[] = array($info['id'], array(), $mock_plugin); + } $this->factory->expects($this->any()) ->method('createInstance') ->will($this->returnValueMap($map)); @@ -325,15 +354,19 @@ protected function setupFactory($mock_plugin) { * The mock plugin. * * @return array - * The expected result, keyed by local task leve. + * The expected result, keyed by local task level. */ protected function getLocalTasksForRouteResult($mock_plugin) { $result = array( 0 => array( 'menu_local_task_test_tasks_settings' => $mock_plugin, - 'menu_local_task_test_tasks_view' => $mock_plugin, + 'menu_local_task_test_tasks_view.tab' => $mock_plugin, 'menu_local_task_test_tasks_edit' => $mock_plugin, - ) + ), + 1 => array( + 'menu_local_task_test_tasks_view_child1' => $mock_plugin, + 'menu_local_task_test_tasks_view_child2' => $mock_plugin, + ), ); return $result; } @@ -344,16 +377,26 @@ protected function getLocalTasksForRouteResult($mock_plugin) { * @return array */ protected function getLocalTasksCache() { + $local_task_fixtures = $this->getLocalTaskFixtures(); return array( - 'tab_root_ids' => array( + 'base_routes' => array( 'menu_local_task_test_tasks_view' => 'menu_local_task_test_tasks_view', ), 'parents' => array( - 'menu_local_task_test_tasks_view' => 1, + 'menu_local_task_test_tasks_view.tab' => TRUE, ), 'children' => array( - '> menu_local_task_test_tasks_view' => $this->getLocalTaskFixtures(), - ) + '> menu_local_task_test_tasks_view' => array( + 'menu_local_task_test_tasks_settings' => $local_task_fixtures['menu_local_task_test_tasks_settings'], + 'menu_local_task_test_tasks_edit' => $local_task_fixtures['menu_local_task_test_tasks_edit'], + 'menu_local_task_test_tasks_view.tab' => $local_task_fixtures['menu_local_task_test_tasks_view.tab'], + ), + 'menu_local_task_test_tasks_view.tab' => array( + // The manager will fill in the base_route before caching. + 'menu_local_task_test_tasks_view_child1' => array('base_route' => 'menu_local_task_test_tasks_view') + $local_task_fixtures['menu_local_task_test_tasks_view_child1'], + 'menu_local_task_test_tasks_view_child2' => array('base_route' => 'menu_local_task_test_tasks_view') + $local_task_fixtures['menu_local_task_test_tasks_view_child2'], + ), + ), ); }