Skip to content
Snippets Groups Projects
Unverified Commit f168bc6a authored by Chris Snyder's avatar Chris Snyder Committed by Lucas Hedding
Browse files

Issue #3178459 by g0blin79, chrissnyder, heddn: Group content menu block is...

Issue #3178459 by g0blin79, chrissnyder, heddn: Group content menu block is always rendered on all pages (also if there is no menu to render)
parent 364d06c2
No related branches found
Tags 8.x-1.0
No related merge requests found
......@@ -165,6 +165,10 @@ class GroupMenuBlock extends BlockBase implements ContainerFactoryPluginInterfac
*/
public function build() {
$menu_name = $this->getMenuName();
// If unable to determine the menu, prevent the block from rendering.
if (!$menu_name = $this->getMenuName()) {
return [];
}
if ($this->configuration['expand_all_items']) {
$parameters = new MenuTreeParameters();
$active_trail = $this->menuActiveTrail->getActiveTrailIds($menu_name);
......@@ -174,7 +178,6 @@ class GroupMenuBlock extends BlockBase implements ContainerFactoryPluginInterfac
$parameters = $this->menuTree->getCurrentRouteMenuTreeParameters($menu_name);
}
// Adjust the menu tree parameters based on the block's configuration.
$level = $this->configuration['level'];
$depth = $this->configuration['depth'];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment