-
Bug
-
Resolution: Fixed
-
Minor
-
2.4.6, 2.5
-
MOODLE_24_STABLE, MOODLE_25_STABLE
-
MOODLE_24_STABLE, MOODLE_25_STABLE
-
wip-
MDL-41967-master -
When custom profile fields have been created and then enabled in the gradebook general settings, the download of the gradebook fails with the following problem:
Debug info: ERROR: syntax error at or near "'customfield_firstdate'"
|
LINE 1: SELECT u.*, cf0.data AS 'customfield_firstdate' , u.lastname...
|
^
|
SELECT u.*, cf0.data AS 'customfield_firstdate' , u.lastname AS usrt1, u.firstname AS usrt2, u.id AS usrt
|
FROM mdl_user u
|
JOIN (SELECT DISTINCT eu1_u.id
|
FROM mdl_user eu1_u
|
JOIN mdl_user_enrolments eu1_ue ON eu1_ue.userid = eu1_u.id
|
JOIN mdl_enrol eu1_e ON (eu1_e.id = eu1_ue.enrolid AND eu1_e.courseid = $1)
|
WHERE eu1_u.deleted = 0 AND eu1_u.id <> $2 AND eu1_ue.status = $3 AND eu1_e.status = $4 AND eu1_ue.timestart < $5 AND (eu1_ue.timeend = 0 OR eu1_ue.timeend > $6)) je ON je.id = u.id
|
|
LEFT JOIN (SELECT * FROM mdl_user_info_data
|
WHERE fieldid = $7) cf0
|
ON u.id = cf0.userid
|
JOIN (
|
SELECT DISTINCT ra.userid
|
FROM mdl_role_assignments ra
|
WHERE ra.roleid = $8
|
AND ra.contextid IN ($9,$10,$11)
|
) rainner ON rainner.userid = u.id
|
WHERE u.deleted = 0
|
|
ORDER BY usrt1 ASC, usrt2 ASC, usrt ASC
|
[array (
|
0 => '2',
|
1 => '1',
|
2 => 0,
|
3 => 0,
|
4 => 1380092900,
|
5 => 1380092900,
|
6 => '1',
|
7 => '5',
|
8 => '41',
|
9 => '3',
|
10 => '1',
|
)]
|
Error code: dmlreadexception
|
Stack trace:
|
|
line 436 of /lib/dml/moodle_database.php: dml_read_exception thrown
|
line 239 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
|
line 702 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
|
line 214 of /grade/lib.php: call to pgsql_native_moodle_database->get_recordset_sql()
|
line 244 of /grade/export/lib.php: call to graded_users_iterator->init()
|
line 62 of /grade/export/txt/index.php: call to grade_export->display_preview()
|
This isn't a problem when using mysql, but is present in postgres