Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-31915

Code to delete a course module should be fully self-contained

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 2.1.4
    • Course
    • MOODLE_21_STABLE

      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

            moodle.com Moodle HQ
            dobedobedoh Andrew Lyons
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.