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

Block restore for modules can fail or insert invalid block_instance records

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.8.4
    • Fix Version/s: 1.8.5, 1.9
    • Component/s: Backup
    • Labels:
      None
    • Affected Branches:
      MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE

      Description

      In the backup process, all block from all modules are backed up regardless if the module has been selected for backup. So, during the restore process, the block restore code never checks to see if the pageid remaps correctly. This results in the pageid being set to NULL, causing the restore to fail, or the pageid being set to 0, creating an invalid block_instance record.

      Attached is a fix in the restore process. A further fix would be to only backup those blocks that belong to modules that are actually being backed up. Regardless though, I think the attached patch should be added to restorelib.php.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                3/Mar/08