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

Block restore for modules can fail or insert invalid block_instance records

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 1.8.5, 1.9
    • 1.8.4
    • Backup
    • None
    • MOODLE_18_STABLE
    • MOODLE_18_STABLE, MOODLE_19_STABLE

      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.

            stronk7 Eloy Lafuente (stronk7)
            bushido Mark Nielsen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

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