Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Not a bug
-
Affects Version/s: 2.6.4
-
Fix Version/s: None
-
Component/s: Navigation, Themes
-
Labels:None
-
Affected Branches:MOODLE_26_STABLE
Description
RECREATE
In a custom theme renderers.php, override render_custom_menu() and add some hard-coded menu item. e.g:
<?php
|
class theme_zebra_core_renderer extends core_renderer {
|
protected function render_custom_menu(custom_menu $menu) {
|
$menu->add('Home', new moodle_url('/'));
|
return parent::render_custom_menu($menu);
|
}
|
}
|
Browse to /admin/settings.php?section=themesettings and configure custommenuitems to be blank (no spaces, no new lines). Save.
EXPECTED RESULTS
The Home menu item will be displayed.
ACTUAL RESULTS
No custom menu items are displayed
CODE
The culprit for this unexpected behavior occurs in lib/outputrenderers.php in function custom_menu:
if (empty($custommenuitems)) {
|
return '';
|
}
|
By returning an empty string when the configured $custommenuitems is blank, the overridden render_custom_menu() is never executed