learnweb/moodle-mod_ratingallocate

error reading from database - ambiguous column name

utmcgrep opened this issue · 0 comments

We are experiencing errors reading from the database when a teacher uses the buttons "manual allocation form" or "show ratings and allocations". The PHP error logs log the following:

[09-Nov-2020 17:47:51 Europe/Berlin] Default exception handler: Fehler beim Lesen der Datenbank Debug: SQLState: 42000<br>
Error Code: 209<br>
Message: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Ambiguous column name 'lastname'.<br>

SELECT
                u.*, u.firstname as firstname, u.lastname as lastname
                FROM mdl_user u
                WHERE u.id in (14754,599,15,4242)
                ORDER BY lastname ASC OFFSET 0 ROWS  FETCH NEXT 20 ROWS ONLY
[array (
)]
Error code: dmlreadexception
* 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 920 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->do_query()
* line 996 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->get_recordset_sql()
* line 1648 of \lib\tablelib.php: call to sqlsrv_native_moodle_database->get_records_sql()
* line 515 of \mod\ratingallocate\classes\ratings_and_allocations_table.php: call to table_sql->query_db()
* line 158 of \mod\ratingallocate\classes\ratings_and_allocations_table.php: call to mod_ratingallocate\ratings_and_allocations_table->init_sql()
* line 652 of \mod\ratingallocate\renderer.php: call to mod_ratingallocate\ratings_and_allocations_table->setup_table()
* line 529 of \mod\ratingallocate\locallib.php: call to mod_ratingallocate_renderer->ratings_table_for_ratingallocate()
* line 727 of \mod\ratingallocate\locallib.php: call to ratingallocate->process_action_show_ratings_and_alloc_table()
* line 61 of \mod\ratingallocate\view.php: call to ratingallocate->handle_view()