Update to Drupal 8.0.0-beta15. For more information, see: https://www.drupal.org/node/2563023
This commit is contained in:
parent
2720a9ec4b
commit
f3791f1da3
1898 changed files with 54300 additions and 11481 deletions
|
@ -8,6 +8,7 @@
|
|||
* used for navigation.
|
||||
*/
|
||||
|
||||
use Drupal\Core\Breadcrumb\Breadcrumb;
|
||||
use Drupal\Core\Cache\CacheableMetadata;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
use Drupal\Core\Block\BlockPluginInterface;
|
||||
|
@ -486,14 +487,14 @@ function menu_ui_preprocess_block(&$variables) {
|
|||
/**
|
||||
* Implements hook_system_breadcrumb_alter().
|
||||
*/
|
||||
function menu_ui_system_breadcrumb_alter(array &$breadcrumb, RouteMatchInterface $route_match, array $context) {
|
||||
function menu_ui_system_breadcrumb_alter(Breadcrumb &$breadcrumb, RouteMatchInterface $route_match, array $context) {
|
||||
// Custom breadcrumb behavior for editing menu links, we append a link to
|
||||
// the menu in which the link is found.
|
||||
if (($route_match->getRouteName() == 'menu_ui.link_edit') && $menu_link = $route_match->getParameter('menu_link_plugin')) {
|
||||
if (($menu_link instanceof MenuLinkInterface)) {
|
||||
// Add a link to the menu admin screen.
|
||||
$menu = Menu::load($menu_link->getMenuName());
|
||||
$breadcrumb[] = Link::createFromRoute($menu->label(), 'entity.menu.edit_form', array('menu' => $menu->id()));
|
||||
$breadcrumb->addLink(Link::createFromRoute($menu->label(), 'entity.menu.edit_form', ['menu' => $menu->id()]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue