Merge branch 'MDL-47555' of https://github.com/rlorenzo/moodle
authorSam Hemelryk <sam@moodle.com>
Thu, 23 Oct 2014 22:17:00 +0000 (11:17 +1300)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Fri, 24 Oct 2014 09:48:21 +0000 (11:48 +0200)
course/view.php

index 1f6d0d4..6acd0f8 100644 (file)
@@ -94,6 +94,9 @@
 
     require_once($CFG->dirroot.'/calendar/lib.php');    /// This is after login because it needs $USER
 
+    // Must set layout before gettting section info. See MDL-47555.
+    $PAGE->set_pagelayout('course');
+
     if ($section and $section > 0) {
 
         // Get section details and check it exists.
     // Fix course format if it is no longer installed
     $course->format = course_get_format($course)->get_format();
 
-    $PAGE->set_pagelayout('course');
     $PAGE->set_pagetype('course-view-' . $course->format);
     $PAGE->set_other_editing_capability('moodle/course:update');
     $PAGE->set_other_editing_capability('moodle/course:manageactivities');