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

Restore should report more about errors when copying the restore file

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.6, 3.1.2, 3.2
    • Fix Version/s: 3.0.7, 3.1.3
    • Component/s: Backup, Files API
    • Labels:
    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_30_STABLE, MOODLE_31_STABLE, MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_30_STABLE, MOODLE_31_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      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

            Assignee:
            timhunt Tim Hunt
            Reporter:
            timhunt Tim Hunt
            Peer reviewer:
            Russell Smith
            Integrator:
            Dan Poltawski
            Tester:
            Ankit Agarwal
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Matteo Scaramuccia, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              14/Nov/16