diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index 9c5d98c9a26..cbc44bfb4d6 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -3816,10 +3816,20 @@ EOD; * @return string */ public function more_menu($content, $navbarstyle) { - return $this->render_from_template('core/moremenu', (object) [ - 'nodearray' => $content, - 'navbarstyle' => $navbarstyle - ]); + if (is_object($content)) { + if (!isset($content->children) || count($content->children) == 0) { + return false; + } + return $this->render_from_template('core/moremenu', (object) [ + 'nodecollection' => $content, + 'navbarstyle' => $navbarstyle + ]); + } else { + return $this->render_from_template('core/moremenu', (object) [ + 'nodearray' => $content, + 'navbarstyle' => $navbarstyle + ]); + } } /** diff --git a/lib/templates/moremenu.mustache b/lib/templates/moremenu.mustache index 0b63ff6c355..b142edd9928 100644 --- a/lib/templates/moremenu.mustache +++ b/lib/templates/moremenu.mustache @@ -46,6 +46,11 @@ }}