Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Merge branch 'MDL-60842-master' of git://github.com/lameze/moodle
- Loading branch information
Showing
with
2 additions
and
2 deletions.
-
+2
−2
calendar/lib.php
|
@@ -2538,7 +2538,7 @@ function calendar_get_allowed_types(&$allowed, $course = null, $groups = null, $ |
|
|
|
|
|
if (!empty($course)) { |
|
|
if (!is_object($course)) { |
|
|
$course = $DB->get_record('course', array('id' => $course), '*', MUST_EXIST); |
|
|
$course = $DB->get_record('course', array('id' => $course), 'id, groupmode, groupmodeforce', MUST_EXIST); |
|
|
} |
|
|
if ($course->id != SITEID) { |
|
|
$coursecontext = \context_course::instance($course->id); |
|
@@ -2602,7 +2602,7 @@ function calendar_get_all_allowed_types() { |
|
|
// This function warms the context cache for the course so the calls |
|
|
// to load the course context in calendar_get_allowed_types don't result |
|
|
// in additional DB queries. |
|
|
$courses = calendar_get_default_courses(null, '*', true); |
|
|
$courses = calendar_get_default_courses(null, 'id, groupmode, groupmodeforce', true); |
|
|
|
|
|
// We want to pre-fetch all of the groups for each course in a single |
|
|
// query to avoid calendar_get_allowed_types from hitting the DB for |
|
|