diff --git a/blocks/navigation/renderer.php b/blocks/navigation/renderer.php index fe91aed2b10..4c3d28cf507 100644 --- a/blocks/navigation/renderer.php +++ b/blocks/navigation/renderer.php @@ -77,6 +77,11 @@ class block_navigation_renderer extends plugin_renderer_base { $isexpandable = (empty($expansionlimit) || ($item->type > navigation_node::TYPE_ACTIVITY || $item->type < $expansionlimit) || ($item->contains_active_node() && $item->children->count() > 0)); $isbranch = $isexpandable && ($item->children->count() > 0 || ($item->has_children() && (isloggedin() || $item->type <= navigation_node::TYPE_CATEGORY))); + // Skip elements which have no content and no action - no point in showing them + if (!$isexpandable && empty($item->action)) { + continue; + } + $hasicon = ((!$isbranch || $item->type == navigation_node::TYPE_ACTIVITY || $item->type == navigation_node::TYPE_RESOURCE) && $item->icon instanceof renderable); if ($hasicon) {