-
Bug
-
Resolution: Fixed
-
Minor
-
4.1.2
There is an edge case where the user entity is used twice in the same report (only example being the notes report source currently), and there is a custom user field that is added to the report, either as a column or condition/filter, for both entity instances
It leads to the following DML exception, because each tries to use the same table alias:
dmlreadexception
|
Error reading from database
|
File: /lib/dml/moodle_database.php
|
Line: 494
|
Stack trace:
|
|
Not unique table/alias: 'upfs3'
|
|
SELECT COUNT(1)
|
FROM (SELECT np.content AS c0_content, np.format AS c0_format, u.firstname AS c1_firstname, upfs3.data AS c2_data, au.firstname AS c3_firstname, upfs3.data AS c4_data
|
FROM mdl_post np LEFT JOIN mdl_user u
|
ON u.id = np.userid LEFT JOIN mdl_user_info_data upfs3
|
ON upfs3.userid = u.id
|
AND upfs3.fieldid = 3 LEFT JOIN mdl_user au
|
ON au.id = np.usermodified LEFT JOIN mdl_user_info_data upfs3
|
ON upfs3.userid = au.id
|
AND upfs3.fieldid = 3
|
WHERE np.module = ? AND (COALESCE( CAST(upfs3.data AS SIGNED) , 0) = ?) AND (COALESCE( CAST(upfs3.data AS SIGNED) , 0) = ?)
|
|
) rbalias16
|
[array (
|
0 => 'notes',
|
1 => 0,
|
2 => 0,
|
)]
|
Error code: dmlreadexception
|
* line 494 of /lib/dml/moodle_database.php: dml_read_exception thrown
|
* line 293 of /lib/dml/moodle_read_slave_trait.php: call to moodle_database->query_end()
|
* line 1371 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->query_end()
|
* line 1679 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
|
* line 1752 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
|
* line 1962 of /lib/dml/moodle_database.php: call to moodle_database->get_field_sql()
|
* line 177 of /reportbuilder/classes/table/base_report_table.php: call to moodle_database->count_records_sql()
|
* line 371 of /reportbuilder/classes/table/custom_report_table.php: call to core_reportbuilder\table\base_report_table->query_db()
|
* line 85 of /reportbuilder/classes/output/renderer.php: call to core_reportbuilder\table\custom_report_table->out()
|
* line 495 of /lib/outputrenderers.php: call to core_reportbuilder\output\renderer->render_custom_report_table()
|
* line 191 of /reportbuilder/classes/external/custom_report_exporter.php: call to plugin_renderer_base->render()
|
* line 121 of /lib/classes/external/exporter.php: call to core_reportbuilder\external\custom_report_exporter->get_other_values()
|
* line 73 of /reportbuilder/classes/output/custom_report.php: call to core\external\exporter->export()
|
* line 50 of /reportbuilder/classes/output/dynamictabs/editor.php: call to core_reportbuilder\output\custom_report->export_for_template()
|
* line 87 of /lib/classes/external/dynamic_tabs_get_content.php: call to core_reportbuilder\output\dynamictabs\editor->export_for_template()
|
* line ? of unknownfile: call to core\external\dynamic_tabs_get_content::execute()
|
* line 251 of /lib/external/classes/external_api.php: call to call_user_func_array()
|
* line 83 of /lib/ajax/service.php: call to core_external\external_api::call_external_func
|
Caused by MDL-75733
- Discovered while testing
-
MDL-77700 Include user in custom report for comments on blog entries
-
- Closed
-
- is a regression caused by
-
MDL-75733 Remove duplicate column/filter join on user profile fields in custom reports
-
- Closed
-
- Testing discovered
-
MDL-52351 Site notes and personal notes cannot be added unless student is in a course
-
- Closed
-