Project: moodle
Issue MDL-42767: Notes for deleted courses causes error
When a note is added for a user at the course level on the user's notes page and then that course is deleted, an error results on the note's page that the deleted course can not be found. Steps to replicate -> Enable user notes on your site. Browse your list of users for a user that is enrolled in a class. In the navigation menu, under users, choose Notes. Under one of the courses, choose "Add a new note". Add a note, leaving it at the course context and save. Delete the course you added the note for. Go back to the user's note page: Can not find data record in database table course. More information about this error Debug info: SELECT * FROM {course} WHERE id = ? [array ( 0 => 42, )] Error code: invalidrecord Stack trace: line 1372 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown line 1348 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select() line 42 of /notes/index.php: call to moodle_database->get_record()
Story points: 13