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

IMSCC restore doesn't use configured temp directory

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Edit config.php and set $CFG->tempdir to something other than the default location, (e.g. /[path/to/the/folder/that/contains/moodledata]/moodletemp/). Make sure this folder exists.
      2. Log in as an admin and go to "Site administration / Courses / Restore course"
      3. Restore the attached ims-common-cartridge-test-export.imscc to a new course.
      4. Confirm that you are able to successfully restore this backup file to a course.
      Show
      Edit config.php and set $CFG->tempdir to something other than the default location, (e.g. / [path/to/the/folder/that/contains/moodledata] /moodletemp/). Make sure this folder exists. Log in as an admin and go to " Site administration / Courses / Restore course " Restore the attached ims-common-cartridge-test-export.imscc to a new course. Confirm that you are able to successfully restore this backup file to a course.
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE
    • Fixed Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      master-MDL-64290-imscc-restore-temp-dir

      Description

      If a Moodle site has set $CFG->tempdir set to something other than the default location, restoring an imscc file fails with error "The selected file is not a valid Moodle backup file and can't be restored." This is because in backup/converter/imscc1/lib.php and backup/converter/imscc11/lib.php the path is hard coded to

      $CFG->dataroot . '/temp/backup/' . $tempdir;

      Steps to reproduce:

      1.  Set Set $CFG->tempdir to something other than the default location, such as, /moodletemp/
      2. Create an imscc backup on the Moodle site or upload an already created one.
      3. Attempt to restore the imscc file.

      I will create fix on a branch in github.

       

        Attachments

          Activity

            People

            Assignee:
            mspall Michael Spall
            Reporter:
            mspall Michael Spall
            Peer reviewer:
            Damyon Wiese Damyon Wiese
            Integrator:
            Jun Pataleta Jun Pataleta
            Tester:
            Janelle Barcega Janelle Barcega
            Participants:
            Component watchers:
            Darko Miletic, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
            Votes:
            5 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              14/Jan/19

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 31 minutes
                31m