I'm looking into MDL-31914 and have noticed that the code to delete a module is quite separated and there's room for error.
- Some of the code is in course/mod.php (e.g. calling the $cm->modname . "_delete_instance" function, deleting area files, trigger the mod_deleted event, log the event, delete_mod_from_section, rebuild_course_cache.
- Some of this is duplicated in the AJAX delete handler (course/rest.php)
- The remainder (deleting course modules, course completion, events, etc) is handled in course/lib.php::delete_course_module.
IMHO this should all be moved to the delete_course_module() function which already takes a course_module ID
- has a non-specific relationship to
-
MDL-36789 Corrupt modinfo in course table [problem and a fix]
-
- Closed
-