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

Moodle does not delete empty course_modules after the restore

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.5, 1.9
    • Fix Version/s: 1.8.7, 1.9.3
    • Component/s: Backup
    • Labels:
      None
    • Database:
      Any
    • Affected Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE
    • Fixed Branches:
      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

              Assignee:
              mudrd8mz David Mudrák (@mudrd8mz)
              Reporter:
              mudrd8mz David Mudrák (@mudrd8mz)
              Tester:
              Petr Skoda
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
              Votes:
              10 Vote for this issue
              Watchers:
              16 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                15/Oct/08