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

Restore should report more about errors when copying the restore file

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.0.6, 3.1.2, 3.2
    • 3.0.7, 3.1.3
    • Backup, Files API
    • MOODLE_30_STABLE, MOODLE_31_STABLE, MOODLE_32_STABLE
    • MOODLE_30_STABLE, MOODLE_31_STABLE
    • Hide

      I don't know how to trigger this error condition (you could just hack $fileinfo->copy_to_pathname to return false).

      However, I was seeing this failure at the OU, and decided it would be good to improve the error handling here.

      I guess the main thing is to test that this does not introduce a regression. That is, you need to restore a .mbz file but uploading it, and you can complete the process.

      Show
      I don't know how to trigger this error condition (you could just hack $fileinfo->copy_to_pathname to return false). However, I was seeing this failure at the OU, and decided it would be good to improve the error handling here. I guess the main thing is to test that this does not introduce a regression. That is, you need to restore a .mbz file but uploading it, and you can complete the process.

    Description

      If you restore by uploading a file, then when the file is copied to the temp folder at the start of the process, no check is done on the return code of the copy.

      Therefore, if the copy fails, you just get an error message after the redirect that does not seem to make any sense. Reporting the error as soon as it is detected shold make debugging easier.

      Sadly, there is no way to know what caused the error, since the API just returns true/false, rather than throwing an informative exception.

      Attachments

        Activity

          People

            timhunt Tim Hunt
            timhunt Tim Hunt
            Russell Smith Russell Smith
            Dan Poltawski Dan Poltawski
            Ankit Agarwal Ankit Agarwal
            Adrian Greeve, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo, Matteo Scaramuccia, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              14/Nov/16