MDL-31186 fix wrong context preloading sql

This commit is contained in:
Petr Skoda 2012-01-21 16:08:25 +01:00
parent f6b4ec2b4a
commit ecfc06d88a

View File

@ -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);