-
Bug
-
Resolution: Fixed
-
Minor
-
2.8
-
MOODLE_28_STABLE
-
MOODLE_27_STABLE
-
47631-28
-
To reproduce:
- Create a course
- Enrol 30 students
- Browse to the course participation report
- Select a letter to filter users by (firstname or lastname, it doesn't matter)
- Boom!
Debug info: ERROR: syntax error at or near "WHERE"
LINE 15: ....alternatename,u.firstname,u.lastname, u.idnumber WHERE firs...
^
SELECT ra.userid, u.firstnamephonetic,u.lastnamephonetic,u.middlename,u.alternatename,u.firstname,u.lastname, u.idnumber, COUNT(l.actioncount) AS count
FROM (SELECT DISTINCT userid FROM mdl_role_assignments WHERE contextid IN ($1,$2,$3) AND roleid = $4 ) ra
JOIN mdl_user u ON u.id = ra.useridLEFT JOIN (
SELECT userid, COUNT(crud) AS actioncount
FROM mdl_logstore_standard_log
WHERE contextinstanceid = $5
AND timecreated > $6 AND crud IN ($7,$8,$9,$10)
AND edulevel = $11
AND anonymous = 0
AND contextlevel = $12
AND (origin = 'web' OR origin = 'ws')
GROUP BY userid,timecreated) l ON (l.userid = ra.userid)
GROUP BY ra.userid, u.firstnamephonetic,u.lastnamephonetic,u.middlename,u.alternatename,u.firstname,u.lastname, u.idnumber WHERE firstname ILIKE $13 ESCAPE E'
' ORDER BY lastname DESC LIMIT 20 OFFSET 0
[array (
0 => '63',
1 => '3',
2 => '1',
3 => 5,
4 => 4,
5 => 0,
6 => 'c',
7 => 'r',
8 => 'u',
9 => 'd',
10 => 2,
11 => 70,
12 => 'L%',
)]
Error code: dmlreadexceptionStack trace:
line 443 of /lib/dml/moodle_database.php: dml_read_exception thrown
line 244 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
line 764 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
line 302 of /report/participation/index.php: call to pgsql_native_moodle_database->get_records_sql()