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

tool_uploadcourse: Invalid restore files are not well handled

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6
    • Fix Version/s: 2.6, BACKEND
    • Component/s: Administration
    • Labels:
    • Testing Instructions:
      Hide
      1. Create a CSV file containing the following keys:
        • shortname
        • fullname
        • category (set to 1)
        • backupfile (full path to a .mbz file)
        • templatecourse (shortname of an existing course)
      2. Create 4 different courses, they must not exist.
        • 1 with a valid backupfile, leave templatecourse empty
        • 1 with an invalid backupfile (file does not exist), leave templatecourse empty
        • 1 with a valid templatecourse, leave backupfile empty
        • 1 with an invalid templatecourse, leave backupfile empty
      3. Use the CSV in tool_uploadcourse
      4. Make sure you can go through the entire process
      5. Make sure the 2 courses with valid data are created and the content of backupfile or templatecourse has been imported in them
      6. Make sure the 2 invalid entries, and marked as invalid with the reason why
      Show
      Create a CSV file containing the following keys: shortname fullname category (set to 1) backupfile (full path to a .mbz file) templatecourse (shortname of an existing course) Create 4 different courses, they must not exist. 1 with a valid backupfile, leave templatecourse empty 1 with an invalid backupfile (file does not exist), leave templatecourse empty 1 with a valid templatecourse, leave backupfile empty 1 with an invalid templatecourse, leave backupfile empty Use the CSV in tool_uploadcourse Make sure you can go through the entire process Make sure the 2 courses with valid data are created and the content of backupfile or templatecourse has been imported in them Make sure the 2 invalid entries, and marked as invalid with the reason why
    • Affected Branches:
      MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-41347-master
    • Story Points:
      3

      Description

      If there are invalid restore files (or courses to restore from), the prepare() method does not return false, even though it logs the errors. This causes the proceed() method to be called, which raises an exception because it should not happen.

      The course method to get the content restore dir should return whether it was successful or not, in order to return false during the prepare method.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  18/Nov/13