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

Ignore unknown setting levels during restore instead of throwing exception

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.3, 2.7.3
    • 3.0
    • Backup
    • MOODLE_23_STABLE, MOODLE_27_STABLE
    • MOODLE_30_STABLE
    • MDL-36957-master
    • Hide
      1. Backup a course and download the .mbz file
      2. In the package, edit the file moodle_backup.xml and add the following setting in settings:

              <setting>
                <level>invalid</level>
                <name>unknown</name>
                <value>1</value>
              </setting>
        

      3. Try to restore the backup file on a non-patched Moodle, it should fail with "wrong_setting_level_moodle_backup_xml_file"
      4. On the instance containing the patch, restore the backup file
      5. Confirm the backup was restored successfully, though a debugging message will be displayed informing devs of the invalid setting level.
      Show
      Backup a course and download the .mbz file In the package, edit the file moodle_backup.xml and add the following setting in settings : <setting> <level>invalid</level> <name>unknown</name> <value>1</value> </setting> Try to restore the backup file on a non-patched Moodle, it should fail with "wrong_setting_level_moodle_backup_xml_file" On the instance containing the patch, restore the backup file Confirm the backup was restored successfully, though a debugging message will be displayed informing devs of the invalid setting level.
    • Team Beards Sprint 5, Team '; drop tables Sprint 6

    Description

      In backup_general_helper::get_backup_information(), it throws the following exception when it encounters an unknown setting level:

      throw new backup_helper_exception('wrong_setting_level_moodle_backup_xml_file', $setting['level']);

      Instead of throwing an error, would it be possible to just ignore the setting and allow the restore to take place? The current design prevents backup portability when the backup has been customized.

      Attachments

        Activity

          People

            fred Frédéric Massart
            bushido Mark Nielsen
            Dave Cooper Dave Cooper
            Dan Poltawski Dan Poltawski
            Rajesh Taneja Rajesh Taneja
            Adrian Greeve, David Woloszyn, Huong Nguyen, Jake Dallimore, Michael Hawkins, Stevani Andolo
            Votes:
            1 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              16/Nov/15