-
Bug
-
Resolution: Not a bug
-
Minor
-
None
-
2.4, 2.5, 2.6
-
MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
A local plugin can create a function in it's lib.php to extend the navigation.
If this function tries to access $PAGE->settingsnav when viewing mod/quiz/edit.php, a fatal error happens with the message "Undefined property: moodle_page::$settingsnav"
I'm not quite sure what the right way to fix this is. Perhaps quiz_extend_settings_navigation() should be used instead of the current code in mod/quiz/edit.php:
$node = $PAGE->settingsnav->find('mod_quiz_edit', navigation_node::TYPE_SETTING);
|
if ($node) {
|
$node->make_active();
|
}
|
Alternatively, lib/navigationlib.php could call load_local_plugin_settings after it marks itself as initialised:
diff --git a/lib/navigationlib.php b/lib/navigationlib.php
|
index d37f406..f5ea55b 100644
|
--- a/lib/navigationlib.php
|
+++ b/lib/navigationlib.php
|
@@ -3301,15 +3301,15 @@ class settings_navigation extends navigation_node {
|
$this->add(get_string('returntooriginaluser', 'moodle', fullname($realuser, true)), $url, self::TYPE_SETTING, null, null, new pix_icon('t/left', ''));
|
}
|
|
- // At this point we give any local plugins the ability to extend/tinker with the navigation settings.
|
- $this->load_local_plugin_settings();
|
-
|
foreach ($this->children as $key=>$node) {
|
if ($node->nodetype != self::NODETYPE_BRANCH || $node->children->count()===0) {
|
$node->remove();
|
}
|
}
|
$this->initialised = true;
|
+
|
+ // At this point we give any local plugins the ability to extend/tinker with the navigation settings.
|
+ $this->load_local_plugin_settings();
|
}
|
/**
|
* Override the parent function so that we can add preceeding hr's and set a
|