Issue #2239833 by Wim Leers: Regression: Menu contextual links no longer visible in menu blocks.

8.0.x
Nathaniel Catchpole 2014-04-28 20:29:56 +01:00
parent 677b9fc45f
commit dda140f91e
1 changed files with 4 additions and 6 deletions

View File

@ -300,12 +300,10 @@ function menu_ui_block_view_system_menu_block_alter(array &$build, BlockPluginIn
// Add contextual links for system menu blocks.
$menus = menu_list_system_menus();
$menu_name = $block->getDerivativeId();
if (isset($menus[$menu_name]) && isset($build['content'])) {
foreach (Element::children($build['content']) as $key) {
$build['#contextual_links']['menu'] = array(
'route_parameters' => array('menu' => $build['content'][$key]['#original_link']['menu_name']),
);
}
if (isset($menus[$menu_name])) {
$build['#contextual_links']['menu'] = array(
'route_parameters' => array('menu' => $menu_name),
);
}
}