Commit 0a423910 authored by webchick's avatar webchick

Issue #2177031 by dawehner, tim.plunkett, Berdir: Remove menu_get_item() and every use of it. .

parent 5072c181
......@@ -212,7 +212,7 @@ services:
arguments: ['@controller_resolver', '@request', '@router.route_provider', '@module_handler', '@cache.cache', '@language_manager', '@access_manager', '@current_user']
plugin.manager.menu.local_task:
class: Drupal\Core\Menu\LocalTaskManager
arguments: ['@controller_resolver', '@request', '@router.route_provider', '@module_handler', '@cache.cache', '@language_manager', '@access_manager', '@current_user']
arguments: ['@controller_resolver', '@request', '@router.route_provider', '@router.builder', '@module_handler', '@cache.cache', '@language_manager', '@access_manager', '@current_user']
plugin.manager.menu.contextual_link:
class: Drupal\Core\Menu\ContextualLinkManager
arguments: ['@controller_resolver', '@module_handler', '@cache.cache', '@language_manager', '@access_manager', '@current_user']
......
This diff is collapsed.
......@@ -224,10 +224,6 @@ function drupal_valid_path($path, $dynamic_allowed = FALSE) {
$route_name = $item['route_name'];
}
}
else {
$item = menu_get_item($path);
$route_name = $item['route_name'];
}
// Check the new routing system.
if (!empty($route_name)) {
$map = array();
......@@ -239,5 +235,5 @@ function drupal_valid_path($path, $dynamic_allowed = FALSE) {
$item['access'] = menu_item_route_access($route, $path, $map, $request);
}
$menu_admin = FALSE;
return $item && $item['access'];
return !empty($item['access']);
}
......@@ -18,6 +18,7 @@
use Drupal\Core\Plugin\Discovery\ContainerDerivativeDiscoveryDecorator;
use Drupal\Core\Plugin\Discovery\YamlDiscovery;
use Drupal\Core\Plugin\Factory\ContainerFactory;
use Drupal\Core\Routing\RouteBuilderInterface;
use Drupal\Core\Routing\RouteProviderInterface;
use Drupal\Core\Session\AccountInterface;
use Symfony\Component\HttpFoundation\Request;
......@@ -83,6 +84,13 @@ class LocalTaskManager extends DefaultPluginManager {
*/
protected $routeProvider;
/**
* The route builder.
*
* @var \Drupal\Core\Routing\RouteBuilderInterface
*/
protected $routeBuilder;
/**
* The access manager.
*
......@@ -106,6 +114,8 @@ class LocalTaskManager extends DefaultPluginManager {
* The request object to use for building titles and paths for plugin instances.
* @param \Drupal\Core\Routing\RouteProviderInterface $route_provider
* The route provider to load routes by name.
* @param \Drupal\Core\Routing\RouteBuilderInterface $route_builder
* The route builder.
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler.
* @param \Drupal\Core\Cache\CacheBackendInterface $cache
......@@ -117,13 +127,14 @@ class LocalTaskManager extends DefaultPluginManager {
* @param \Drupal\Core\Session\AccountInterface $account
* The current user.
*/
public function __construct(ControllerResolverInterface $controller_resolver, Request $request, RouteProviderInterface $route_provider, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache, LanguageManager $language_manager, AccessManager $access_manager, AccountInterface $account) {
public function __construct(ControllerResolverInterface $controller_resolver, Request $request, RouteProviderInterface $route_provider, RouteBuilderInterface $route_builder, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache, LanguageManager $language_manager, AccessManager $access_manager, AccountInterface $account) {
$this->discovery = new YamlDiscovery('local_tasks', $module_handler->getModuleDirectories());
$this->discovery = new ContainerDerivativeDiscoveryDecorator($this->discovery);
$this->factory = new ContainerFactory($this);
$this->controllerResolver = $controller_resolver;
$this->request = $request;
$this->routeProvider = $route_provider;
$this->routeBuilder = $route_builder;
$this->accessManager = $access_manager;
$this->account = $account;
$this->alterInfo($module_handler, 'local_tasks');
......@@ -177,6 +188,9 @@ public function getLocalTasksForRoute($route_name) {
$children = $cache->data['children'];
}
else {
// Maybe some code asked to rebuild the routes, so rebuild the router
// as we rely on having proper existing routes in dynamic local tasks.
$this->routeBuilder->rebuildIfNeeded();
$definitions = $this->getDefinitions();
// We build the hierarchy by finding all tabs that should
// appear on the current route.
......
......@@ -10,5 +10,5 @@ custom_block_add_action:
appears_on:
- block.admin_display
- block.admin_display_theme
- custom_block.list
class: \Drupal\custom_block\Plugin\Menu\LocalAction\CustomBlockAddLocalAction
......@@ -37,25 +37,6 @@ function custom_block_help($path, $arg) {
}
}
/**
* Implements hook_menu_local_tasks().
*/
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');
if ($item['access']) {
// Add a destination parameter.
$item['localized_options']['query']['destination'] = 'admin/structure/block/custom-blocks';
$data['actions']['block/add'] = array(
'#theme' => 'menu_local_action',
'#link' => $item,
);
}
}
}
/**
* Implements hook_menu().
*/
......
......@@ -8,6 +8,7 @@
namespace Drupal\custom_block\Plugin\Menu\LocalAction;
use Drupal\Core\Menu\LocalActionDefault;
use Symfony\Cmf\Component\Routing\RouteObjectInterface;
use Symfony\Component\HttpFoundation\Request;
/**
......@@ -24,6 +25,10 @@ public function getOptions(Request $request) {
if ($request->attributes->has('theme')) {
$options['query']['theme'] = $request->attributes->get('theme');
}
// Adds a destination on custom block listing.
if ($request->attributes->get(RouteObjectInterface::ROUTE_NAME) == 'custom_block.list') {
$options['query']['destination'] = 'admin/structure/block/custom-blocks';
}
return $options;
}
......
......@@ -614,8 +614,8 @@ public function bookTreeAllData($menu_name, $link = NULL, $max_depth = NULL) {
* @return array
* A structured array to be rendered by drupal_render().
*
* Note: copied from menu_tree_output() but some hacky code using
* menu_get_item() was removed.
* @todo This was copied from menu_tree_output() but with some changes that
* may be obsolete. Attempt to resolve the differences.
*/
public function bookTreeOutput(array $tree) {
$build = array();
......
......@@ -3,3 +3,8 @@ node.type_add:
title: 'Add content type'
appears_on:
- node.overview_types
node.add_page:
route_name: node.add_page
title: 'Add content'
appears_on:
- node.content_overview
......@@ -1008,23 +1008,6 @@ function node_menu_link_defaults() {
return $links;
}
/**
* Implements hook_menu_local_tasks().
*/
function node_menu_local_tasks(&$data, $route_name) {
// Add action link to 'node/add' on 'admin/content' page.
// @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(
'#theme' => 'menu_local_action',
'#link' => $item,
);
}
}
}
/**
* Title callback: Displays the node's title.
*
......
......@@ -329,7 +329,7 @@ function shortcut_valid_link($path) {
}
// An empty path is valid too and will be converted to <front>.
return (!url_is_external($path) && (\Drupal::service('router.route_provider')->getRoutesByPattern('/' . $path)->count() > 0 || menu_get_item($path))) || empty($path) || $path == '<front>';
return (!url_is_external($path) && (\Drupal::service('router.route_provider')->getRoutesByPattern('/' . $path)->count() > 0)) || empty($path) || $path == '<front>';
}
/**
......
......@@ -8,6 +8,9 @@
namespace Drupal\system\Form;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Entity\Query\QueryFactory;
use Drupal\Core\Entity\Query\QueryFactoryInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Form\FormBase;
use Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface;
......@@ -38,6 +41,20 @@ class ModulesListForm extends FormBase {
*/
protected $keyValueExpirable;
/**
* The entity manager.
*
* @var \Drupal\Core\Entity\EntityManagerInterface
*/
protected $entityManager;
/**
* The query factory.
*
* @var \Drupal\Core\Entity\Query\QueryFactory
*/
protected $queryFactory;
/**
* {@inheritdoc}
*/
......@@ -45,7 +62,9 @@ public static function create(ContainerInterface $container) {
return new static(
$container->get('module_handler'),
$container->get('keyvalue.expirable')->get('module_list'),
$container->get('access_manager')
$container->get('access_manager'),
$container->get('entity.manager'),
$container->get('entity.query')
);
}
......@@ -58,11 +77,17 @@ public static function create(ContainerInterface $container) {
* The key value expirable factory.
* @param \Drupal\Core\Access\AccessManager $access_manager
* Access manager.
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager.
* @param \Drupal\Core\Entity\Query\QueryFactory $query_factory
* The entity query factory.
*/
public function __construct(ModuleHandlerInterface $module_handler, KeyValueStoreExpirableInterface $key_value_expirable, AccessManager $access_manager) {
public function __construct(ModuleHandlerInterface $module_handler, KeyValueStoreExpirableInterface $key_value_expirable, AccessManager $access_manager, EntityManagerInterface $entity_manager, QueryFactory $query_factory) {
$this->moduleHandler = $module_handler;
$this->keyValueExpirable = $key_value_expirable;
$this->accessManager = $access_manager;
$this->entityManager = $entity_manager;
$this->queryFactory = $query_factory;
}
/**
......@@ -199,7 +224,11 @@ protected function buildRow(array $modules, $module, $distribution) {
$row['links']['configure'] = array();
if ($module->status && isset($module->info['configure'])) {
if ($this->accessManager->checkNamedRoute($module->info['configure'], array(), \Drupal::currentUser())) {
$item = menu_get_item(trim($this->url($module->info['configure']), '/'));
$result = $this->queryFactory->get('menu_link')
->condition('route_name', $module->info['configure'])
->execute();
$menu_items = $this->entityManager->getStorageController('menu_link')->loadMultiple($result);
$item = reset($menu_items);
$row['links']['configure'] = array(
'#type' => 'link',
'#title' => $this->t('Configure'),
......
......@@ -8,9 +8,11 @@
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Entity\EntityManagerInterface;
use Symfony\Cmf\Component\Routing\RouteObjectInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\Database\Connection;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Symfony\Component\HttpFoundation\Request;
/**
* System Manager Service.
......@@ -60,6 +62,13 @@ class SystemManager {
*/
const REQUIREMENT_ERROR = 2;
/**
* The request object.
*
* @var \Symfony\Component\HttpFoundation\Request
*/
protected $request;
/**
* Constructs a SystemManager object.
*
......@@ -76,6 +85,16 @@ public function __construct(ModuleHandlerInterface $module_handler, Connection $
$this->menuLinkStorage = $entity_manager->getStorageController('menu_link');
}
/**
* Sets the current request.
*
* @param \Symfony\Component\HttpFoundation\Request $request
* The request object.
*/
public function setRequest(Request $request) {
$this->request = $request;
}
/**
* Checks for requirement severity.
*
......@@ -160,7 +179,9 @@ public function getMaxSeverity(&$requirements) {
* A render array suitable for drupal_render.
*/
public function getBlockContents() {
$item = menu_get_item();
$route_name = $this->request->attributes->get(RouteObjectInterface::ROUTE_NAME);
$items = $this->menuLinkStorage->loadByProperties(array('route_name' => $route_name));
$item = reset($items);
if ($content = $this->getAdminBlock($item)) {
$output = array(
'#theme' => 'admin_block_content',
......@@ -185,14 +206,6 @@ public function getBlockContents() {
* An array of menu items, as expected by theme_admin_block_content().
*/
public function getAdminBlock($item) {
// If we are calling this function for a menu item that corresponds to a
// local task (for example, admin/tasks), then we want to retrieve the
// parent item's child links, not this item's (since this item won't have
// any).
if ($item['tab_root'] != $item['path']) {
$item = menu_get_item($item['tab_root_href']);
}
if (!isset($item['mlid'])) {
$menu_links = $this->menuLinkStorage->loadByProperties(array('link_path' => $item['path'], 'module' => 'system'));
if ($menu_links) {
......
......@@ -24,96 +24,6 @@ public static function getInfo() {
);
}
/**
* Tests appearance of local tasks.
*
* @see menu_test_menu()
* @see menu_test_menu_local_tasks()
* @see menu_test_menu_local_tasks_alter()
*/
function testLocalTasks() {
// Verify that there is no local tasks markup if none are defined in the
// router and no module adds any dynamically.
$this->drupalGet('menu-test/tasks/empty');
$this->assertNoRaw('tabs');
$this->drupalGet('menu-test/tasks/default');
$this->assertNoRaw('tabs');
// Verify that local tasks appear as defined in the router.
$this->drupalGet('menu-test/tasks/tasks');
$this->assertLocalTasks(array(
// MENU_DEFAULT_LOCAL_TASK is expected to get a default weight of -10
// (without having to define it manually), so it should appear first,
// despite that its label is "View".
'menu-test/tasks/tasks',
'menu-test/tasks/tasks/edit',
'menu-test/tasks/tasks/settings',
));
// Enable addition of tasks in menu_test_menu_local_tasks().
\Drupal::config('menu_test.settings')->set('tasks.add', TRUE)->save();
// Verify that the added tasks appear even if there are no tasks normally.
$this->drupalGet('menu-test/tasks/empty');
$this->assertLocalTasks(array(
'task/foo',
'task/bar',
));
// Verify that the default local task appears before the added tasks.
$this->drupalGet('menu-test/tasks/default');
$this->assertLocalTasks(array(
'menu-test/tasks/default',
'task/foo',
'task/bar',
));
// Verify that the added tasks appear within normal tasks.
$this->drupalGet('menu-test/tasks/tasks');
$this->assertLocalTasks(array(
'menu-test/tasks/tasks',
// The Edit task defines no weight, which is expected to sort as 0.
'menu-test/tasks/tasks/edit',
'task/foo',
'task/bar',
'menu-test/tasks/tasks/settings',
));
// Enable manipulation of tasks in menu_test_menu_local_tasks_alter().
\Drupal::config('menu_test.settings')->set('tasks.alter', TRUE)->save();
// Verify that the added tasks appear even if there are no tasks normally.
$this->drupalGet('menu-test/tasks/empty');
$this->assertLocalTasks(array(
'task/bar',
'task/foo',
));
$this->assertNoText('Show it');
$this->assertText('Advanced settings');
// Verify that the default local task appears before the added tasks.
$this->drupalGet('menu-test/tasks/default');
$this->assertLocalTasks(array(
'menu-test/tasks/default',
'task/bar',
'task/foo',
));
$this->assertText('Show it');
$this->assertText('Advanced settings');
// Verify that the added tasks appear within normal tasks.
$this->drupalGet('menu-test/tasks/tasks');
$this->assertLocalTasks(array(
'menu-test/tasks/tasks',
'menu-test/tasks/tasks/edit',
'task/bar',
'menu-test/tasks/tasks/settings',
'task/foo',
));
$this->assertText('Show it');
$this->assertText('Advanced settings');
}
/**
* Asserts local tasks in the page output.
*
......
......@@ -52,8 +52,9 @@ public function testMenuRouterRebuildContext() {
menu_router_rebuild();
// Check that the language context was not used for building the menu item.
$menu_item = menu_get_item('menu-test/context');
$this->assertTrue($menu_item['title'] == 'English', 'Config context overrides are ignored when rebuilding menu router items.');
$menu_items = \Drupal::entityManager()->getStorageController('menu_link')->loadByProperties(array('route_name' => 'menu_test.context'));
$menu_item = reset($menu_items);
$this->assertTrue($menu_item['link_title'] == 'English', 'Config context overrides are ignored when rebuilding menu router items.');
}
}
......@@ -64,7 +64,6 @@ public function testMenuIntegration() {
$this->doTestTitleMenuCallback();
$this->doTestMenuOptionalPlaceholders();
$this->doTestMenuOnRoute();
$this->doTestMenuGetItemNoAncestors();
$this->doTestMenuName();
$this->doTestMenuItemTitlesCases();
$this->doTestMenuLinkMaintain();
......@@ -205,14 +204,6 @@ protected function doTestMenuHierarchy() {
$this->assertEqual($unattached_child_link['plid'], $parent_link['mlid'], 'The parent of a non-directly attached child is correct.');
}
/**
* Test menu_get_item() with empty ancestors.
*/
protected function doTestMenuGetItemNoAncestors() {
\Drupal::state()->set('menu.masks', array());
$this->drupalGet('');
}
/**
* Test menu maintenance hooks.
*/
......
......@@ -433,38 +433,6 @@ function hook_page_build(&$page) {
}
}
/**
* Alter a menu router item right after it has been retrieved from the database or cache.
*
* This hook is invoked by menu_get_item() and allows for run-time alteration of router
* information (page_callback, title, and so on) before it is translated and checked for
* access. The passed-in $router_item is statically cached for the current request, so this
* hook is only invoked once for any router item that is retrieved via menu_get_item().
*
* Usually, modules will only want to inspect the router item and conditionally
* perform other actions (such as preparing a state for the current request).
* Note that this hook is invoked for any router item that is retrieved by
* menu_get_item(), which may or may not be called on the path itself, so implementations
* should check the $path parameter if the alteration should fire for the current request
* only.
*
* @param $router_item
* The menu router item for $path.
* @param $path
* The originally passed path, for which $router_item is responsible.
* @param $original_map
* The path argument map, as contained in $path.
*
* @see menu_get_item()
*/
function hook_menu_get_item_alter(&$router_item, $path, $original_map) {
// When retrieving the router item for the current path...
if ($path == current_path()) {
// ...call a function that prepares something for this request.
mymodule_prepare_something();
}
}
/**
* Define links for menus.
*
......
......@@ -1879,14 +1879,23 @@ function system_get_module_admin_tasks($module, $info) {
// Append link for permissions.
if (\Drupal::moduleHandler()->implementsHook($module, 'permission')) {
$item = menu_get_item('admin/people/permissions');
if (!empty($item['access'])) {
$item['link_path'] = $item['href'];
$item['title'] = t('Configure @module permissions', array('@module' => $info['name']));
unset($item['description']);
$item['localized_options']['fragment'] = 'module-' . $module;
$item = entity_create('menu_link', $item);
$admin_tasks["admin/people/permissions#module-$module"] = $item;
/** @var \Drupal\Core\Access\AccessManager $access_manager */
$access_manager = \Drupal::service('access_manager');
/** @var \Drupal\menu_link\MenuLinkStorageControllerInterface $menu_link_storage_controller */
$menu_link_storage_controller = \Drupal::entityManager()
->getStorageController('menu_link');
if ($access_manager->checkNamedRoute('user.admin_permissions', array(), \Drupal::currentUser())) {
$path = \Drupal::urlGenerator()
->getPathFromRoute('user.admin_permissions');
$options = array();
$options['fragment'] = 'module-' . $module;
$menu_link = $menu_link_storage_controller->create(array(
'route_name' => 'user.admin_permissions',
'link_path' => $path,
'title' => t('Configure @module permissions', array('@module' => $info['name'])),
'localized_options' => $options
));
$admin_tasks["user.admin.people.permissions.$module"] = $menu_link;
}
}
......
......@@ -6,6 +6,8 @@ services:
system.manager:
class: Drupal\system\SystemManager
arguments: ['@module_handler', '@database', '@entity.manager']
calls:
- [setRequest, ['@?request=']]
system.breadcrumb.default:
class: Drupal\system\PathBasedBreadcrumbBuilder
arguments: ['@request', '@entity.manager', '@access_manager', '@router', '@path_processor_manager', '@config.factory', '@title_resolver']
......
......@@ -67,3 +67,18 @@ menu_test.tasks_settings_tab:
title: 'Settings'
weight: 100
base_route: menu_test.tasks_tasks
menu_test.router_test1:
route_name: menu_test.router_test1
title: 'Local task A'
base_route: menu_test.router_test1
menu_test.router_test2:
route_name: menu_test.router_test2
title: 'Local task B'
base_route: menu_test.router_test1
menu_test.router_test3:
route_name: menu_test.router_test3
title: 'Local task C'
base_route: menu_test.router_test1
......@@ -88,122 +88,6 @@ function menu_test_menu() {
'title' => 'Menu test root',
'route_name' => 'menu_test.menu_test',
);
$items['menu-test/hidden'] = array(
'title' => 'Hidden test root',
'route_name' => 'menu_test.hidden',
);
// Hidden tests; one dynamic argument.
$items['menu-test/hidden/menu'] = array(
'title' => 'Menus',
'route_name' => 'menu_test.hidden_menu',
);
$items['menu-test/hidden/menu/list'] = array(
'title' => 'List menus',
'type' => MENU_DEFAULT_LOCAL_TASK,
);
$items['menu-test/hidden/menu/settings'] = array(
'title' => 'Settings',
'route_name' => 'menu_test.hidden_menu_settings',
'type' => MENU_LOCAL_TASK,
'weight' => 5,
);
$items['menu-test/hidden/menu/manage/%menu'] = array(
'title' => 'Customize menu',
'route_name' => 'menu_test.hidden_manage',
);
$items['menu-test/hidden/menu/manage/%menu/list'] = array(
'title' => 'List links',
'type' => MENU_DEFAULT_LOCAL_TASK,
'context' => MENU_CONTEXT_PAGE,
);
$items['menu-test/hidden/menu/manage/%menu/edit'] = array(
'title' => 'Edit menu',
'route_name' => 'menu_test.hidden_manage_edit',
'type' => MENU_LOCAL_TASK,
'context' => MENU_CONTEXT_PAGE,
);
$items['menu-test/hidden/menu/manage/%menu/delete'] = array(
'title' => 'Delete menu',
'route_name' => 'menu_test.hidden_manage_delete',
);
// Hidden tests; two dynamic arguments.
$items['menu-test/hidden/block'] = array(
'title' => 'Blocks',
'route_name' => 'menu_test.hidden_block',
);
$items['menu-test/hidden/block/list'] = array(
'title' => 'List',
'type' => MENU_DEFAULT_LOCAL_TASK,
);
$items['menu-test/hidden/block/manage/%/%'] = array(
'title' => 'Configure block',
'route_name' => 'menu_test.hidden_block_configure',
);
$items['menu-test/hidden/block/manage/%/%/delete'] = array(
'title' => 'Delete block',
'route_name' => 'menu_test.hidden_block_delete',
'type' => MENU_LOCAL_TASK,
'context' => MENU_CONTEXT_NONE,
);
// Breadcrumbs tests.
// @see \Drupal\system\Tests\Menu\BreadcrumbTest
// Local tasks: Second level below default local task.
$items['menu-test/breadcrumb/tasks'] = array(
'title' => 'Breadcrumbs test: Local tasks',
'route_name' => 'menu_test.breadcrumbs',
);
$items['menu-test/breadcrumb/tasks/first'] = array(
'title' => 'First',
'type' => MENU_DEFAULT_LOCAL_TASK,
'route_name' => 'menu_test.breadcrumbs_first',
);
$items['menu-test/breadcrumb/tasks/second'] = array(
'title' => 'Second',
'type' => MENU_LOCAL_TASK,
'route_name' => 'menu_test.breadcrumbs_second',
);
$items['menu-test/breadcrumb/tasks/first/first'] = array(
'title' => 'First first',
'type' => MENU_DEFAULT_LOCAL_TASK,
'route_name' => 'menu_test.breadcrumbs_first_first',
);
$items['menu-test/breadcrumb/tasks/first/second'] = array(
'title' => 'First second',
'type' => MENU_LOCAL_TASK,
'route_name' => 'menu_test.breadcrumbs_first_second',
);
$items['menu-test/breadcrumb/tasks/second/first'] = array(
'title' => 'Second first',
'type' => MENU_DEFAULT_LOCAL_TASK,
'route_name' => 'menu_test.breadcrumbs_second_first',
);
$items['menu-test/breadcrumb/tasks/second/second'] = array(
'title' => 'Second second',
'type' => MENU_LOCAL_TASK,
'route_name' => 'menu_test.breadcrumbs_second_second',
);
// Menu local tasks tests.
// @see \Drupal\system\Tests\Menu\TrailTest
$items['menu-test/tasks'] = array(
'title' => 'Local tasks',
'route_name' => 'menu_test.tasks',
);
$items['menu-test/tasks/empty'] = array(
'title' => 'Empty',
'route_name' => 'menu_test.tasks_empty',
);
$items['menu-test/tasks/default'] = array(
'title' => 'Default only',
'route_name' => 'menu_test.tasks_default',
);
$items['menu-test/tasks/tasks'] = array(
'title' => 'With tasks',
'route_name' => 'menu_test.tasks_tasks',
);
// Menu trail tests.
// @see MenuTrailTestCase
......@@ -241,28 +125,6 @@ function menu_test_menu() {
'route_name' => 'menu_test.title_test_case3',
);
// Parent page for controller-based local tasks.
$items['foo/%'] = array(
'title' => 'Controller-based local tasks',
'route_name' => 'menu_test.router_test1',
);
// Controller-based local task.
$items['foo/%/a'] = array(