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

Restore fails if there is local settings

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • 2.1.3, 2.2.2, 2.3
    • None
    • Backup

    Description

      Discussion at http://moodle.org/mod/forum/discuss.php?d=200428

      I upload the file, click restore, and get presented with the error under step 1. Confirm:

      error/wrong_setting_level_moodle_backup_xml_file

      The restore is dying because the file moodle_backup.xml has some invalid 'levels' in lines like this:
      <moodlebackup>
      ...
      <information>
      ...
      <settings>
      ...
      <setting>
      <level>local</level>
      <name>pld_logs_included</name>
      <value>0</value>
      </setting>

      If you edit backup/util/helper/backup_general_helper.php in the function get_backup_information() line ~204 says

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

      Add the first line below and comment out that "throw new..." line like this:

      continue; //added this line to prevent stopping on <level>local</level>
      //throw new backup_helper_exception('wrong_setting_level_moodle_backup_xml_file', $setting['level']);

      The backup will happily chug along now. Tested in 2.1.3 (Build 20111128) (201170103).

      Attachments

        1. Math 1050.mbz
          1.02 MB
        2. Math 1050.mbz
          1.02 MB

        Issue Links

          Activity

            People

              nebgor Aparup Banerjee
              mwebster Mark van Hoek
              David Monllaó David Monllaó
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Adrian Greeve, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: