mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
Avoid a set_url notice on this page when user isn't enrolled
This commit is contained in:
parent
e35fb47974
commit
088e33633b
@ -35,6 +35,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
$PAGE->set_url('/course/view.php', array('id' => $course->id)); // Defined here to avoid notices on errors etc
|
||||
|
||||
preload_course_contexts($course->id);
|
||||
if (!$context = get_context_instance(CONTEXT_COURSE, $course->id)) {
|
||||
print_error('nocontext');
|
||||
@ -89,7 +91,6 @@
|
||||
$course->format = 'weeks'; // Default format is weeks
|
||||
}
|
||||
|
||||
$PAGE->set_url('/course/view.php', array('id' => $course->id));
|
||||
$PAGE->set_pagelayout('course');
|
||||
$PAGE->set_pagetype('course-view-' . $course->format);
|
||||
$PAGE->set_other_editing_capability('moodle/course:manageactivities');
|
||||
|
Loading…
x
Reference in New Issue
Block a user