-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
Future Dev
As outlined in MDL-68365 there are cases where the core_course\task\course_delete_modules fails because there are records in the course_modules table (and possibly context and course_sections tables) but no record in the corresponding module table itself, e.g. assign
In these cases we are in an inconsistent state where some required data is missing, so we can't remove the modules cleanly. But admins should still have an option via a cli script to clean things up as best we can.
Conceptually, this is likely going to be a version of course_delete_module that continues on even when some steps fail (throw errors), cleaning up things as best as they can be done.
This will still be required even when the root cause is addressed