From 6fa877e24382cb44dfe25fd3edc1896367d6eb77 Mon Sep 17 00:00:00 2001 From: Rex Lorenzo Date: Mon, 6 Oct 2014 14:10:51 -0700 Subject: [PATCH] MDL-47555 core_availability: Issue with page layout & grade restriction * Set pagelayout before getting section info, otherwise conditional activity renderers will default to the default 'base' layout. --- course/view.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/course/view.php b/course/view.php index 1f6d0d4ec65..6acd0f83a64 100644 --- a/course/view.php +++ b/course/view.php @@ -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. @@ -112,7 +115,6 @@ // 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');