-
Bug
-
Resolution: Fixed
-
Minor
-
3.7.4, 3.8.1
-
MOODLE_37_STABLE, MOODLE_38_STABLE
-
MOODLE_37_STABLE, MOODLE_38_STABLE
-
As reported in the following thread: https://moodle.org/mod/forum/discuss.php?d=396403
The changes in MDL-67458 introduced an upgrade step that cleans up Cohort role records for roles that no longer exist. Unfortunately if you have removed that plugin prior to upgrading, the step will fail with a DML exception:
Debug info: ERROR: relation "m_tool_cohortroles" does not exist
|
LINE 1: DELETE FROM m_tool_cohortroles WHERE roleid NOT IN (SELECT i...
|
^
|
DELETE FROM m_tool_cohortroles WHERE roleid NOT IN (SELECT id FROM m_role)
|
[array (
|
)]
|
Error code: dmlwriteexception
|
Stack trace:
|
|
line 489 of /lib/dml/moodle_database.php: dml_write_exception thrown
|
line 259 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
|
line 1282 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
|
line 2110 of /lib/db/upgrade.php: call to pgsql_native_moodle_database->delete_records_select()
|
line 1850 of /lib/upgradelib.php: call to xmldb_main_upgrade()
|
line 518 of /admin/index.php: call to upgrade_core()
|