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

Using backup_general_helper::get_backup_information() too early in the UI

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Backup
    • Labels:
      None
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      Hi Sam,

      just read somewhere (I think it was in the forums) that uploading one 1.9 backup file leads to one cryptic error (exception) in the early stages of restore. So I've uploaded one 1.9 backup file and have confirmed that this is thrown:

      Backup is missing XML file: /Users/stronk7/Sites/moodle_data_git_head/temp/backup/XXXXXXXXXXXXXX
      line 119 of /backup/util/helper/backup_general_helper.class.php: backup_helper_exception thrown
      line 172 of /backup/util/ui/restore_ui_stage.class.php: call to backup_general_helper::get_backup_information()
      line 56 of /backup/restore.php: call to restore_ui_stage_confirm->display()

      The key here is that we are trying to execute backup_general_helper::get_backup_information() assuming that the directory contains one Moodle 2.0 backup. IMO, before calling that we must know which type of file and show the corresponding information (surely one nice message saying that 1.9 => 2.0 isn't implemented yet) as far a as a lot of users are going to try 1.9 backups for sure.

      There is the static backup_general_helper::detect_backup_format($tempdir) method that will return you some information. You can execute it freely (without instantiating the whole restore controller).

      Once we start working on conversions we'll have to organize all this again, to see where exactly detection/conversion happen, because right now the final flow isn't properly defined IMO. So let's talk about that later (here or in another bug). Surely we'll end instantiating the controller earlier (without courseid) to make it to perform the needed format checks and conversions... but we aren't going to do that yet.

      But, as commented we need that detection running and displaying a nice message in early stages ASAP.

      Ciao

        Attachments

          Activity

            People

            • Assignee:
              samhemelryk Sam Hemelryk
              Reporter:
              stronk7 Eloy Lafuente (stronk7)
              Tester:
              Nobody
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                24/Nov/10