diff --git a/user/externallib.php b/user/externallib.php index cf2576f5735..04ab81a0440 100644 --- a/user/externallib.php +++ b/user/externallib.php @@ -518,7 +518,7 @@ class core_user_external extends external_api { $courses = array(); list($cselect, $cjoin) = context_instance_preload_sql('c.id', CONTEXT_COURSE, 'ctx'); list($sqlcourseids, $params) = $DB->get_in_or_equal(array_unique($courseids)); - $coursesql = "SELECT c.* $uselect + $coursesql = "SELECT c.* $cselect FROM {course} c $cjoin WHERE c.id $sqlcourseids"; $rs = $DB->get_recordset_sql($coursesql, $params);