diff --git a/core/includes/menu.inc b/core/includes/menu.inc index c8fddcd..27196d1 100644 --- a/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -1994,14 +1994,15 @@ function menu_local_tasks($level = 0) { // If we failed to fetch a router item or the current user doesn't have // access to it, don't bother computing the tabs. - if (!$router_item || !$router_item['access']) { + if ((!$route_name && !$router_item) || ($router_item && !$router_item['access'])) { return $empty; } + // @todo remove all code using {menu_router} and anything using MENU_* // constants when all local actions and local tasks are converted to // plugins. The remaining code should just invoke those managers plus do the // invocations of hook_menu_local_tasks() and hook_menu_local_tasks_alter(). - + if ($router_item) { // Get all tabs (also known as local tasks) and the root page. $result = db_select('menu_router', NULL, array('fetch' => PDO::FETCH_ASSOC)) ->fields('menu_router') @@ -2170,15 +2171,16 @@ function menu_local_tasks($level = 0) { // Remove the depth, we are interested only in their relative placement. $tabs = array_values($tabs); $data['tabs'] += $tabs; + } // Allow modules to dynamically add further tasks. $module_handler = \Drupal::moduleHandler(); foreach ($module_handler->getImplementations('menu_local_tasks') as $module) { $function = $module . '_menu_local_tasks'; - $function($data, $router_item, $root_path); + $function($data, $route_name); } // Allow modules to alter local tasks. - $module_handler->alter('menu_local_tasks', $data, $router_item, $root_path); + $module_handler->alter('menu_local_tasks', $data, $route_name); } if (isset($data['tabs'][$level])) { diff --git a/core/modules/block/custom_block/custom_block.module b/core/modules/block/custom_block/custom_block.module index eed50a4..8e81778 100644 --- a/core/modules/block/custom_block/custom_block.module +++ b/core/modules/block/custom_block/custom_block.module @@ -30,8 +30,8 @@ function custom_block_help($path, $arg) { /** * Implements hook_menu_local_tasks(). */ -function custom_block_menu_local_tasks(&$data, $router_item, $root_path) { - if ($router_item['route_name'] == 'custom_block.list') { +function custom_block_menu_local_tasks(&$data, $route_name) { + if ($route_name == 'custom_block.list') { // @todo Move to a LocalAction plugin when https://drupal.org/node/2045267 // allows local actions to work with query strings. $item = menu_get_item('block/add'); @@ -48,13 +48,13 @@ function custom_block_menu_local_tasks(&$data, $router_item, $root_path) { $routes = array_map(function ($theme) { return "block.admin_display_$theme"; }, array_keys(list_themes())); - if (in_array($router_item['route_name'], $routes)) { + if (in_array($route_name, $routes)) { // @todo Move to a LocalAction plugin when https://drupal.org/node/2045267 // allows local actions to work with query strings. $item = menu_get_item('block/add'); if ($item['access']) { // Add a destination parameter. - $item['localized_options']['query']['theme'] = end($router_item['map']); + $item['localized_options']['query']['theme'] = \Drupal::request()->attributes->get('theme'); $data['actions']['block/add'] = array( '#theme' => 'menu_local_action', '#link' => $item, diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentNonNodeTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentNonNodeTest.php index e269aa5..8f999b6 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentNonNodeTest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentNonNodeTest.php @@ -372,7 +372,7 @@ function testCommentFunctionality() { $data = array('bundle' => 'entity_test_render', 'name' => $random_label); $new_entity = entity_create('entity_test_render', $data); $new_entity->save(); - $this->drupalGet('entity_test_render/manage/' . $new_entity->id() . '/edit'); + $this->drupalGet('entity_test_render/manage/' . $new_entity->id()); $this->assertNoFieldChecked('edit-field-foobar-0-status-1'); $this->assertFieldChecked('edit-field-foobar-0-status-2'); $this->assertNoField('edit-field-foobar-0-status-0'); diff --git a/core/modules/content_translation/content_translation.local_tasks.yml b/core/modules/content_translation/content_translation.local_tasks.yml index 151c584..6e4a6bb 100644 --- a/core/modules/content_translation/content_translation.local_tasks.yml +++ b/core/modules/content_translation/content_translation.local_tasks.yml @@ -1,3 +1,4 @@ content_translation.local_tasks: derivative: 'Drupal\content_translation\Plugin\Derivative\ContentTranslationLocalTasks' + class: 'Drupal\content_translation\Plugin\ContentTranslationLocalTasks' weight: 100 diff --git a/core/modules/content_translation/content_translation.module b/core/modules/content_translation/content_translation.module index 2b6a611..a3a074a 100644 --- a/core/modules/content_translation/content_translation.module +++ b/core/modules/content_translation/content_translation.module @@ -148,20 +148,6 @@ function content_translation_menu() { $item[str_replace('_', ' ', $key)] = $value; } - $items["$path/translations"] = array( - 'title' => 'Translate', - 'route_name' => "content_translation.translation_overview_$entity_type", - 'type' => MENU_LOCAL_TASK, - 'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE, - 'weight' => 2, - ) + $item; - - $items["$path/translations/overview"] = array( - 'title' => 'Overview', - 'type' => MENU_DEFAULT_LOCAL_TASK, - 'weight' => 0, - ); - // Add translation callback. // @todo Add the access callback instead of replacing it as soon as the // routing system supports multiple callbacks. diff --git a/core/modules/content_translation/lib/Drupal/content_translation/Access/ContentTranslationManageAccessCheck.php b/core/modules/content_translation/lib/Drupal/content_translation/Access/ContentTranslationManageAccessCheck.php index 3a53710..2c87894 100644 --- a/core/modules/content_translation/lib/Drupal/content_translation/Access/ContentTranslationManageAccessCheck.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/Access/ContentTranslationManageAccessCheck.php @@ -46,7 +46,7 @@ public function appliesTo() { * {@inheritdoc} */ public function access(Route $route, Request $request) { - if ($entity = $request->attributes->get('entity')) { + if ($entity = $request->attributes->get('_entity')) { $route_requirements = $route->getRequirements(); $operation = $route_requirements['_access_content_translation_manage']; $entity_type = $entity->entityType(); diff --git a/core/modules/content_translation/lib/Drupal/content_translation/Access/ContentTranslationOverviewAccess.php b/core/modules/content_translation/lib/Drupal/content_translation/Access/ContentTranslationOverviewAccess.php index 116e9c5..ca37e49 100644 --- a/core/modules/content_translation/lib/Drupal/content_translation/Access/ContentTranslationOverviewAccess.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/Access/ContentTranslationOverviewAccess.php @@ -45,7 +45,7 @@ public function appliesTo() { * {@inheritdoc} */ public function access(Route $route, Request $request) { - if ($entity = $request->attributes->get('entity')) { + if ($entity = $request->attributes->get('_entity')) { // Get entity base info. $entity_type = $entity->entityType(); $bundle = $entity->bundle(); diff --git a/core/modules/content_translation/lib/Drupal/content_translation/Controller/ContentTranslationController.php b/core/modules/content_translation/lib/Drupal/content_translation/Controller/ContentTranslationController.php index ec229e1..f94ad33 100644 --- a/core/modules/content_translation/lib/Drupal/content_translation/Controller/ContentTranslationController.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/Controller/ContentTranslationController.php @@ -17,28 +17,28 @@ class ContentTranslationController { /** * @todo Remove content_translation_overview(). */ - public function overview(EntityInterface $entity) { + public function overview(EntityInterface $_entity) { module_load_include('pages.inc', 'content_translation'); - return content_translation_overview($entity); + return content_translation_overview($_entity); } /** * @todo Remove content_translation_add_page(). */ - public function add(EntityInterface $entity, $source, $target) { + public function add(EntityInterface $_entity, $source, $target) { module_load_include('pages.inc', 'content_translation'); $source = language_load($source); $target = language_load($target); - return content_translation_add_page($entity, $source, $target); + return content_translation_add_page($_entity, $source, $target); } /** * @todo Remove content_translation_edit_page(). */ - public function edit(EntityInterface $entity, $language) { + public function edit(EntityInterface $_entity, $language) { module_load_include('pages.inc', 'content_translation'); $language = language_load($language); - return content_translation_edit_page($entity, $language); + return content_translation_edit_page($_entity, $language); } } diff --git a/core/modules/content_translation/lib/Drupal/content_translation/Plugin/ContentTranslationLocalTasks.php b/core/modules/content_translation/lib/Drupal/content_translation/Plugin/ContentTranslationLocalTasks.php new file mode 100644 index 0000000..32bdb57 --- /dev/null +++ b/core/modules/content_translation/lib/Drupal/content_translation/Plugin/ContentTranslationLocalTasks.php @@ -0,0 +1,41 @@ +pluginDefinition['entity_type']; + if ($raw_variables = $request->attributes->get('_raw_variables')) { + // When the entity type is in the path, populate '_entity' for any dynamic + // local tasks. + if ($raw_variables->has($entity_type)) { + $entity = $raw_variables->get($entity_type); + $parameters['_entity'] = $entity; + } + // When '_entity' is in the path, populate the parameters with the value + // for the actual entity type. + elseif ($raw_variables->has('_entity')) { + $entity = $raw_variables->get('_entity'); + $parameters[$entity_type] = $entity; + } + } + return $parameters; + } + +} 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 764b06a..1cc9e66 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 @@ -14,7 +14,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** - * @todo. + * Provides dynamic local tasks for content translation. */ class ContentTranslationLocalTasks extends DerivativeBase implements ContainerDerivativeInterface { @@ -62,27 +62,28 @@ public function getDerivativeDefinitions(array $base_plugin_definition) { // Create tabs for all possible entity types. foreach ($this->entityManager->getDefinitions() as $entity_type => $entity_info) { if ($entity_info['translatable'] && isset($entity_info['translation'])) { - $path = '/' . str_replace($entity_info['menu_path_wildcard'], '{entity}', $entity_info['menu_base_path']); - $routes = $this->routeProvider->getRoutesByPattern($path)->all(); - if (empty($routes)) { - continue; - } + $path = '/' . preg_replace('/%(.*)/', '{$1}', $entity_info['menu_base_path']); + if ($routes = $this->routeProvider->getRoutesByPattern($path)->all()) { + // Find the route name for the entity page. + $entity_route_name = key($routes); + $entity_tab = $entity_route_name . '_tab'; + // Find the route name for the translation overview. + $translation_route_name = "content_translation.translation_overview_$entity_type"; + $translation_tab = $translation_route_name . '_tab'; - $base_route_name = key($routes); - $tab_root = $base_route_name . '_tab'; - $route_name = "content_translation.translation_overview_$entity_type"; - $tab_name = $route_name . '_tab'; - $this->derivatives[$tab_name] = $base_plugin_definition; - $this->derivatives[$tab_name]['title'] = t('Translate'); - $this->derivatives[$tab_name]['route_name'] = $route_name; - $this->derivatives[$tab_name]['tab_root_id'] = $tab_root; + // Both tabs will have the same root and entity type. + $common_tab_settings = array( + 'tab_root_id' => $entity_tab, + 'entity_type' => $entity_type, + ); + $this->derivatives[$entity_tab] = $base_plugin_definition + $common_tab_settings; + $this->derivatives[$entity_tab]['title'] = t('Edit'); + $this->derivatives[$entity_tab]['route_name'] = $entity_route_name; - // @todo Remove after https://drupal.org/node/2095117. - $tab_name = $tab_root; - $this->derivatives[$tab_name] = $base_plugin_definition; - $this->derivatives[$tab_name]['title'] = t('Edit'); - $this->derivatives[$tab_name]['route_name'] = $base_route_name; - $this->derivatives[$tab_name]['tab_root_id'] = $tab_root; + $this->derivatives[$translation_tab] = $base_plugin_definition + $common_tab_settings; + $this->derivatives[$translation_tab]['title'] = t('Translate'); + $this->derivatives[$translation_tab]['route_name'] = $translation_route_name; + } } } return parent::getDerivativeDefinitions($base_plugin_definition); diff --git a/core/modules/content_translation/lib/Drupal/content_translation/Routing/ContentTranslationRouteSubscriber.php b/core/modules/content_translation/lib/Drupal/content_translation/Routing/ContentTranslationRouteSubscriber.php index 5d30c4c..fb66a24 100644 --- a/core/modules/content_translation/lib/Drupal/content_translation/Routing/ContentTranslationRouteSubscriber.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/Routing/ContentTranslationRouteSubscriber.php @@ -50,7 +50,7 @@ public function routes(RouteBuildEvent $event) { $collection = $event->getRouteCollection(); foreach ($this->entityManager->getDefinitions() as $entity_type => $entity_info) { if ($entity_info['translatable'] && isset($entity_info['translation'])) { - $path = '/' . str_replace($entity_info['menu_path_wildcard'], '{entity}', $entity_info['menu_base_path']) . '/translations'; + $path = '/' . str_replace($entity_info['menu_path_wildcard'], '{_entity}', $entity_info['menu_base_path']) . '/translations'; $route = new Route( $path, array( @@ -64,7 +64,7 @@ public function routes(RouteBuildEvent $event) { ), array( 'parameters' => array( - 'entity' => array( + '_entity' => array( 'type' => 'entity:' . $entity_type, ), ), @@ -87,7 +87,7 @@ public function routes(RouteBuildEvent $event) { ), array( 'parameters' => array( - 'entity' => array( + '_entity' => array( 'type' => 'entity:' . $entity_type, ), ), @@ -108,7 +108,7 @@ public function routes(RouteBuildEvent $event) { ), array( 'parameters' => array( - 'entity' => array( + '_entity' => array( 'type' => 'entity:' . $entity_type, ), ), @@ -129,7 +129,7 @@ public function routes(RouteBuildEvent $event) { ), array( 'parameters' => array( - 'entity' => array( + '_entity' => array( 'type' => 'entity:' . $entity_type, ), ), diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module index 0c1815f..dbd7a43 100644 --- a/core/modules/forum/forum.module +++ b/core/modules/forum/forum.module @@ -148,11 +148,11 @@ function forum_menu() { /** * Implements hook_menu_local_tasks(). */ -function forum_menu_local_tasks(&$data, $router_item, $root_path) { +function forum_menu_local_tasks(&$data, $route_name) { global $user; // Add action link to 'node/add/forum' on 'forum' sub-pages. - if ($root_path == 'forum' || $root_path == 'forum/%') { + if (in_array($route_name, array('forum.index', 'forum.page'))) { $request = \Drupal::request(); $forum_term = $request->attributes->get('taxonomy_term'); $vid = \Drupal::config('forum.settings')->get('vocabulary'); diff --git a/core/modules/node/node.module b/core/modules/node/node.module index 0dcda45..eaa388e 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -1062,9 +1062,10 @@ function node_menu() { /** * Implements hook_menu_local_tasks(). */ -function node_menu_local_tasks(&$data, $router_item, $root_path) { +function node_menu_local_tasks(&$data, $route_name) { // Add action link to 'node/add' on 'admin/content' page. - if ($root_path == 'admin/content') { + // @todo Switch to inspecting route name in https://drupal.org/node/2021161. + if (current_path() == 'admin/content') { $item = menu_get_item('node/add'); if ($item['access']) { $data['actions'][] = array( diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php index f2b0116..d5c1d38 100644 --- a/core/modules/system/system.api.php +++ b/core/modules/system/system.api.php @@ -858,12 +858,10 @@ function hook_menu_alter(&$items) { * associative array as described above. * - tabs: A list of (up to 2) tab levels that contain a list of of tabs keyed * by their href, each one being an associative array as described above. - * @param array $router_item - * The menu system router item of the page. - * @param string $root_path - * The path to the root item for this set of tabs. + * @param string $route_name + * The route name of the page. */ -function hook_menu_local_tasks(&$data, $router_item, $root_path) { +function hook_menu_local_tasks(&$data, $route_name) { // Add an action linking to node/add to all pages. $data['actions']['node/add'] = array( '#theme' => 'menu_local_action', @@ -890,8 +888,6 @@ function hook_menu_local_tasks(&$data, $router_item, $root_path) { ), ), ), - // Define whether this link is active. This can usually be omitted. - '#active' => ($router_item['path'] == $root_path), ); } @@ -904,14 +900,12 @@ function hook_menu_local_tasks(&$data, $router_item, $root_path) { * @param array $data * An associative array containing tabs and actions. See * hook_menu_local_tasks() for details. - * @param array $router_item - * The menu system router item of the page. - * @param string $root_path - * The path to the root item for this set of tabs. + * @param string $route_name + * The route name of the page. * * @see hook_menu_local_tasks() */ -function hook_menu_local_tasks_alter(&$data, $router_item, $root_path) { +function hook_menu_local_tasks_alter(&$data, $route_name) { } /** diff --git a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Controller/EntityTestController.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Controller/EntityTestController.php index 27c42d7..09e604b 100644 --- a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Controller/EntityTestController.php +++ b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Controller/EntityTestController.php @@ -10,7 +10,7 @@ use Drupal\Core\Entity\EntityInterface; /** - * @todo. + * Controller routines for entity_test routes. */ class EntityTestController { @@ -24,8 +24,8 @@ public function testAdd($entity_type) { /** * @todo Remove entity_test_edit() */ - public function testEdit(EntityInterface $entity) { - return entity_test_edit($entity); + public function testEdit(EntityInterface $_entity) { + return entity_test_edit($_entity); } } diff --git a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Routing/RouteSubscriber.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Routing/RouteSubscriber.php index 6e10a3c..0834cc1 100644 --- a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Routing/RouteSubscriber.php +++ b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Routing/RouteSubscriber.php @@ -30,7 +30,10 @@ public static function getSubscribedEvents() { */ public function routes(RouteBuildEvent $event) { $collection = $event->getRouteCollection(); - foreach (entity_test_entity_types() as $entity_type) { + $types = entity_test_entity_types(); + $types[] = 'entity_test_render'; + + foreach ($types as $entity_type) { $route = new Route( "$entity_type/add", array('_content' => '\Drupal\entity_test\Controller\EntityTestController::testAdd', 'entity_type' => $entity_type), @@ -39,11 +42,11 @@ public function routes(RouteBuildEvent $event) { $collection->add("entity_test.add_$entity_type", $route); $route = new Route( - "$entity_type/manage/{entity}", + "$entity_type/manage/{_entity}", array('_content' => '\Drupal\entity_test\Controller\EntityTestController::testEdit'), array('_permission' => 'administer entity_test content'), array('parameters' => array( - 'entity' => array('type' => 'entity:' . $entity_type), + '_entity' => array('type' => 'entity:' . $entity_type), )) ); $collection->add("entity_test.edit_$entity_type", $route); 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 7d270f3..02ce8f2 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 @@ -52,3 +52,22 @@ menu_local_task_test_upcasting_sub2: title: 'upcasting sub2' tab_root_id: menu_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 + +menu_test.tasks_tasks_tab: + route_name: menu_test.tasks_tasks + title: 'View' + tab_root_id: menu_test.tasks_tasks_tab +menu_test.tasks_edit_tab: + route_name: menu_test.tasks_edit + title: 'Edit' + tab_root_id: menu_test.tasks_tasks_tab +menu_test.tasks_settings_tab: + route_name: menu_test.tasks_settings + title: 'Settings' + weight: 100 + tab_root_id: menu_test.tasks_tasks_tab diff --git a/core/modules/system/tests/modules/menu_test/menu_test.module b/core/modules/system/tests/modules/menu_test/menu_test.module index c75b1c7..566a620 100644 --- a/core/modules/system/tests/modules/menu_test/menu_test.module +++ b/core/modules/system/tests/modules/menu_test/menu_test.module @@ -226,29 +226,10 @@ function menu_test_menu() { 'title' => 'Default only', 'route_name' => 'menu_test.tasks_default', ); - $items['menu-test/tasks/default/view'] = array( - 'title' => 'View', - 'type' => MENU_DEFAULT_LOCAL_TASK, - ); $items['menu-test/tasks/tasks'] = array( 'title' => 'With tasks', 'route_name' => 'menu_test.tasks_tasks', ); - $items['menu-test/tasks/tasks/view'] = array( - 'title' => 'View', - 'type' => MENU_DEFAULT_LOCAL_TASK, - ); - $items['menu-test/tasks/tasks/edit'] = array( - 'title' => 'Edit', - 'type' => MENU_LOCAL_TASK, - 'route_name' => 'menu_test.tasks_edit', - ); - $items['menu-test/tasks/tasks/settings'] = array( - 'title' => 'Settings', - 'type' => MENU_LOCAL_TASK, - 'weight' => 100, - 'route_name' => 'menu_test.tasks_settings', - ); // Menu trail tests. // @see MenuTrailTestCase @@ -364,11 +345,11 @@ function menu_test_local_action_dynamic_title($arg) { * If the menu_test.settings configuration 'tasks.add' has been set, adds * several local tasks to menu-test/tasks. */ -function menu_test_menu_local_tasks(&$data, $router_item, $root_path) { +function menu_test_menu_local_tasks(&$data, $route_name) { if (!\Drupal::config('menu_test.settings')->get('tasks.add')) { return; } - if (strpos($router_item['tab_root'], 'menu-test/tasks/') === 0) { + if (in_array($route_name, array('menu_test.tasks_default', 'menu_test.tasks_empty', 'menu_test.tasks_tasks'))) { $data['tabs'][0]['foo'] = array( '#theme' => 'menu_local_task', '#link' => array( @@ -394,17 +375,17 @@ function menu_test_menu_local_tasks(&$data, $router_item, $root_path) { * If the menu_test.settings configuration 'tasks.alter' has been set, adds * several local tasks to menu-test/tasks. */ -function menu_test_menu_local_tasks_alter(&$data, $router_item, $root_path) { +function menu_test_menu_local_tasks_alter(&$data, $route_name) { if (!\Drupal::config('menu_test.settings')->get('tasks.alter')) { return; } - if (strpos($router_item['tab_root'], 'menu-test/tasks/') === 0) { + if (in_array($route_name, array('menu_test.tasks_default', 'menu_test.tasks_empty', 'menu_test.tasks_tasks'))) { // Rename the default local task from 'View' to 'Show'. // $data['tabs'] is expected to be keyed by link hrefs. // The default local task always links to its parent path, which means that // if the tab root path appears as key in $data['tabs'], then that key is // the default local task. - $key = $router_item['tab_root']; + $key = $route_name . '_tab'; if (isset($data['tabs'][0][$key])) { $data['tabs'][0][$key]['#link']['title'] = 'Show it'; } diff --git a/core/modules/system/tests/modules/module_test/lib/Drupal/module_test/Controller/ModuleTestController.php b/core/modules/system/tests/modules/module_test/lib/Drupal/module_test/Controller/ModuleTestController.php index 57357ed..df3b8f7 100644 --- a/core/modules/system/tests/modules/module_test/lib/Drupal/module_test/Controller/ModuleTestController.php +++ b/core/modules/system/tests/modules/module_test/lib/Drupal/module_test/Controller/ModuleTestController.php @@ -8,7 +8,7 @@ namespace Drupal\module_test\Controller; /** - * @todo. + * Controller routines for module_test routes. */ class ModuleTestController { diff --git a/core/modules/system/tests/modules/system_test/lib/Drupal/system_test/Controller/SystemTestController.php b/core/modules/system/tests/modules/system_test/lib/Drupal/system_test/Controller/SystemTestController.php index 3aad7344..db4302f 100644 --- a/core/modules/system/tests/modules/system_test/lib/Drupal/system_test/Controller/SystemTestController.php +++ b/core/modules/system/tests/modules/system_test/lib/Drupal/system_test/Controller/SystemTestController.php @@ -10,7 +10,7 @@ use Drupal\Core\Controller\ControllerBase; /** - * @todo. + * Controller routines for system_test routes. */ class SystemTestController extends ControllerBase {