From 088e33633bd4e0a544266ca89b70fccf4eddb7cc Mon Sep 17 00:00:00 2001 From: Martin Dougiamas Date: Sun, 2 May 2010 09:12:18 +0000 Subject: [PATCH] Avoid a set_url notice on this page when user isn't enrolled --- course/view.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/course/view.php b/course/view.php index 26accf7871b..15b9554b4bd 100644 --- a/course/view.php +++ b/course/view.php @@ -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');