mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
navigation MDL-20218 global_navigation::load_for_user now looks for course id from PAGE first
This commit is contained in:
parent
c5dc10ee58
commit
05c039e564
@ -815,8 +815,12 @@ class global_navigation extends navigation_node {
|
||||
* This gets called by {@link initialise()} when the context is CONTEXT_USER
|
||||
*/
|
||||
protected function load_for_user() {
|
||||
global $DB, $SITE;
|
||||
$courseid = optional_param('course', false, PARAM_INT);
|
||||
global $DB, $SITE, $PAGE;
|
||||
if (!empty($PAGE->course->id)) {
|
||||
$courseid = $PAGE->course->id;
|
||||
} else {
|
||||
$courseid = optional_param('course', false, PARAM_INT);
|
||||
}
|
||||
if ($courseid!==false && $courseid!=$SITE->id) {
|
||||
$course = $DB->get_record('course', array('id'=>$courseid));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user