-
Bug
-
Resolution: Fixed
-
Minor
-
2.6.7, 2.8.6
-
None
-
2014081400
-
PostgreSQL
-
MOODLE_26_STABLE, MOODLE_28_STABLE
-
MOODLE_28_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE
To reproduce this bug, your Moodle installation needs to run on PostgreSQL database server. When creating a simple filter e.g. sort surname field alphabetically, you get an SQL error when using attempting to use the filter in the view entries screen. Please see debug info and stack trace below:
Error reading from database
Debug info: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
SELECT DISTINCT e.id, e.dataid, e.state, e.timecreated, e.timemodified, e.userid, e.groupid, u.id AS uid ,u.picture,u.firstname,u.lastname,u.firstnamephonetic,u.lastnamephonetic,u.middlename,u.alternatename,u.imagealt,u.email,u.idnumber,u.username FROM mdl_dataform_entries e
JOIN mdl_user u ON u.id = e.userid LEFT JOIN mdl_dataform_contents c16 ON c16.fieldid = 16 AND c16.entryid = e.id WHERE e.dataid = $1 ORDER BY c16.content ASC LIMIT 20 OFFSET 0
[array (
0 => '5',
)]
Error code: dmlreadexception
Stack trace:
line 443 of /lib/dml/moodle_database.php: dml_read_exception thrown
line 243 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
line 748 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
line 343 of /mod/dataform/classes/entry_manager.php: call to pgsql_native_moodle_database->get_records_sql()
line 133 of /mod/dataform/classes/entry_manager.php: call to mod_dataform_entry_manager->fetch_entries()
line 341 of /mod/dataform/classes/pluginbase/dataformview.php: call to mod_dataform_entry_manager->set_content()
line 324 of /mod/dataform/classes/pluginbase/dataformview.php: call to mod_dataform\pluginbase\dataformview->set_entries_content()
line 404 of /mod/dataform/classes/dataform.php: call to mod_dataform\pluginbase\dataformview->display()
line 70 of /mod/dataform/view.php: call to mod_dataform_dataform->display()
- duplicates
-
CONTRIB-5714 SQL error when using a filter on entry group.
- Closed
- is duplicated by
-
CONTRIB-6189 Error reading from database - PostgreSQL
- Closed