Skip to content

Commit

Permalink
Merge branch 'MDL-60842-34' of git://github.com/lameze/moodle into MO…
Browse files Browse the repository at this point in the history
…ODLE_34_STABLE
  • Loading branch information
David Monllao committed Nov 20, 2017
2 parents 3cfc322 + 8df6b37 commit b24eb6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions calendar/lib.php
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b24eb6c

Please sign in to comment.