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

Moodle does not delete empty course_modules after the restore

    XMLWordPrintable

Details

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

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              mudrd8mz David Mudrák (@mudrd8mz)
              mudrd8mz David Mudrák (@mudrd8mz)
              Petr Skoda Petr Skoda
              Adrian Greeve, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              10 Vote for this issue
              Watchers:
              16 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                15/Oct/08