When trying to delete a specific user, I get this error:
Can't find data record in database table course.
×Debug info: SELECT id,category FROM {course} WHERE id IS NULL
[array (
)]
Error code: invalidrecord
[array (
)]
Error code: invalidrecord
×Stack trace:
It seems to me there's a reference somewhere in the grades table that's not OK.- line 1599 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
- line 1575 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
- line 6928 of /lib/accesslib.php: call to moodle_database->get_record()
- line 70 of /lib/classes/event/grade_deleted.php: call to context_course::instance()
- line 1122 of /lib/grade/grade_grade.php: call to core\event\grade_deleted::create_from_grade()
- line 1536 of /lib/gradelib.php: call to grade_grade->delete()
- line 4242 of /lib/moodlelib.php: call to grade_user_delete()
- line 107 of /admin/user.php: call to delete_user()
But how to find it? The above was the max info I could get (debug logging on)