MS SQL database error when displaying course with database activity

Issue #977 duplicate
Andrew Campbell created an issue

After upgrading moodle from 2.7 to 3.5 and installing the Adaptable theme the following error occurs when displaying one the of courses:

Debug info: SQLState: 42000<br> Error Code: 8120<br> Message: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Column 'mdl_data.id' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.<br>

SELECT d.id, count(dataid) as total FROM mdl_data_records r, mdl_data d WHERE r.dataid = d.id AND r.dataid = '7' [array ( 0 => '7', )] Error code: dmlreadexception Stack trace:

line 486 of \lib\dml\moodle_database.php: dml_read_exception thrown
line 324 of \lib\dml\sqlsrv_native_moodle_database.php: call to moodle_database->query_end()
line 431 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->query_end()
line 896 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->do_query()
line 972 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->get_recordset_sql()
line 658 of \theme\adaptable\classes\activity.php: call to sqlsrv_native_moodle_database->get_records_sql()
line 129 of \theme\adaptable\classes\activity.php: call to theme_adaptable\activity::data_num_contributions()
line 261 of \theme\adaptable\classes\activity.php: call to theme_adaptable\activity::std_meta()
line ? of unknownfile: call to theme_adaptable\activity::data_meta()
line 43 of \theme\adaptable\classes\activity.php: call to call_user_func()
line 743 of \theme\adaptable\classes\output\core\course_renderer.php: call to theme_adaptable\activity::module_meta()
line 703 of \theme\adaptable\classes\output\core\course_renderer.php: call to theme_adaptable\output\core\course_renderer->course_section_cm_get_meta()
line 846 of \course\renderer.php: call to theme_adaptable\output\core\course_renderer->course_section_cm()
line 1039 of \course\renderer.php: call to core_course_renderer->course_section_cm_list_item()
line 888 of \course\format\renderer.php: call to core_course_renderer->course_section_cm_list()
line 57 of \course\format\topics\format.php: call to format_section_renderer_base->print_multiple_section_page()
line 280 of \course\view.php: call to require()

It was suggested that this might be a possible MSSQL incompatibility and to file an issue.

thanks.

Comments (2)

  1. Log in to comment