Moodle
  1. Moodle
  2. MDL-14326

Moodle does not delete empty course_modules after the restore

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major 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
    • Rank:
      31049

      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.

      1. MDL-14326-commited.patch
        1 kB
        David Mudrak
      2. restorelib.patch
        3 kB
        John T. Macklin

        Issue Links

          Activity

            People

            • Votes:
              10 Vote for this issue
              Watchers:
              17 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: