Moodle
  1. Moodle
  2. MDL-30742

Restore of 1.9 backups with missing question data is not robust

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.3, 2.2
    • Fix Version/s: 2.1.4, 2.2.1
    • Component/s: Backup, Questions
    • Labels:
      None
    • Testing Instructions:
      Hide

      1. Restore the attached backup (backup-edited2.zip).
      2. Verify that the backup can be restored, even though there is data missing from the question definition.

      (Note there is still a notice. However this example data (which came from a real user) is total garbage, so I think we have to tolerate a notice when trying to restore it.)

      Show
      1. Restore the attached backup (backup-edited2.zip). 2. Verify that the backup can be restored, even though there is data missing from the question definition. (Note there is still a notice. However this example data (which came from a real user) is total garbage, so I think we have to tolerate a notice when trying to restore it.)
    • Workaround:
      Hide

      Hunt down the broken question, and delete or fix it on the 1.9 system before generating the backup.

      Show
      Hunt down the broken question, and delete or fix it on the 1.9 system before generating the backup.
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:
    • Rank:
      33641

      Description

      Try to restore the attached backup file into Moodle 2.1 or 2.2. It gives a fatal error.

      Trying to restore into 1.9 just gives a notice but allows the rest of the course to be restored. Moodle 2.1+ should be made similarly tolerant.

        Issue Links

          Activity

          Hide
          Tim Hunt added a comment -

          David, it might have been traditional to ask you for peer-review before submitting this for integration, but I forgot.

          Anyway, it would be great if you could glance at this before the integrators get to it. Thanks.

          Show
          Tim Hunt added a comment - David, it might have been traditional to ask you for peer-review before submitting this for integration, but I forgot. Anyway, it would be great if you could glance at this before the integrators get to it. Thanks.
          Hide
          David Mudrak added a comment -

          Generally, cases like this (ie dealing with corrupted data and/or unexpected XML format) are tricky. If you believe that such situation is far less probable to happen in Moodle 2.x, the solution sounds reasonable. The alternative way would be to make the restore process more benevolent and allow the <plugin_qtype_multichoice_question> be empty (or actually without the <multichoice> node). But yeah, that just smells.

          So, read it as my +1. Thanks for you work on this!

          Show
          David Mudrak added a comment - Generally, cases like this (ie dealing with corrupted data and/or unexpected XML format) are tricky. If you believe that such situation is far less probable to happen in Moodle 2.x, the solution sounds reasonable. The alternative way would be to make the restore process more benevolent and allow the <plugin_qtype_multichoice_question> be empty (or actually without the <multichoice> node). But yeah, that just smells. So, read it as my +1. Thanks for you work on this!
          Hide
          Sam Hemelryk added a comment -

          Thanks guys - this has been integrated now. I also tested this at the same time and will pass it.

          Show
          Sam Hemelryk added a comment - Thanks guys - this has been integrated now. I also tested this at the same time and will pass it.
          Hide
          Sam Hemelryk added a comment -

          Thanks

          Show
          Sam Hemelryk added a comment - Thanks
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Whoever decided one week was worth 14 days had really one bad idea. Anyway, the nightmare is over, so thanks for your, once again, amazing contributions. Many, many thanks!

          Now... disconnect, relax and enjoy the next days, yay!

          Closing...ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Whoever decided one week was worth 14 days had really one bad idea. Anyway, the nightmare is over, so thanks for your, once again, amazing contributions. Many, many thanks! Now... disconnect, relax and enjoy the next days, yay! Closing...ciao

            People

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

              Dates

              • Created:
                Updated:
                Resolved: