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

Moodle does not delete empty course_modules after the restore

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.8.7, 1.9.3
    • 1.8.5, 1.9
    • Backup
    • None
    • Any
    • MOODLE_18_STABLE, MOODLE_19_STABLE
    • MOODLE_18_STABLE, MOODLE_19_STABLE

      PROBLEM
      ========
      During the restore process, an empty course_module is created by backup/restorelib.php (see around line 1000). "Empty" means there is no instance assigned into this module (slot) yet.

      If a module restore fails for some reason, the instance record is not created. User can then see just an icon of an module with no activity title.

      SOLUTION/PROPOSAL
      =================
      As a last step of restore, Moodle should delete all course_modules without instance:

      DELETE FROM course_modules where instance=0;

      Please note, the empty module is deleted anyway, if user clicks on the icon.

            mudrd8mz David Mudrák (@mudrd8mz)
            mudrd8mz David Mudrák (@mudrd8mz)
            Petr Skoda Petr Skoda
            Votes:
            10 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated:
              Resolved:

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