Sorry, I'm not sure if this was properly fixed... I've continued finding orphan records in a lot of places (see
MDL-24087, MDL-24091 for example).
IMO this needs a complete review and an structured way to delete things. All the bugs above raised following these steps:
1) create one new 2.0 installation with MySQL
2) create one course, with one activity of each type, using everything within them (comments, ratings, repositories, blocks, tags, files, course completion, activity completion and availability, enrollments ...)
3) go to admin/courses and delete the course
4) look to all the candidate tables, they must be empty. If not... we are keeping orphaned records.
And that is only testing course deletion, IMO all these should be tested:
- course deletion
- course clear contents
- course reset
- activity deletion
- block deletion
Not sure if this is the place or a new one is necessary to cover the whole thing but all those orphans shouldn't be there, just that. I'm not reopening this, but needs some attention indeed.