I hope someone can help me with this issue. When I try to delete certain users, I get the following message.
Can not find data record in database table course.This doesn't happen to all users that I try to remove. But this is a problem when bulk deleting users.
More information about this error
Debug info: SELECT id,category FROM {course} WHERE id IS NULL
[array (
)]
Error code: invalidrecord
Stack trace:
line 1455 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
line 1431 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
line 6884 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 1036 of /lib/grade/grade_grade.php: call to core\event\grade_deleted::create_from_grade()
line 1335 of /lib/gradelib.php: call to grade_grade->delete()
line 3946 of /lib/moodlelib.php: call to grade_user_delete()
line 90 of /admin/user.php: call to delete_user()
I'm using Moodle 2.9
Thanks for any pointers or suggestions.
Kev