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

Exceptions thrown by restore_format_weeks_plugin.class

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3, 3.3 regressions
    • Fix Version/s: 3.3.1
    • Component/s: Backup
    • Testing Instructions:
      Hide
      Test 1
      1. Visit a Moodle 3.1 site.
      2. Create a course using the weekly format.
      3. Backup the course.
      4. Visit a Moodle 3.3 site.
      5. Ensure debugging is turned on.
      6. Restore the course in Moodle 3.3 and ensure there is no PHP error in your apache log.
      7. Confirm the setting 'Calculate the end date from the number of sections' for the restored course is enabled.
      Test 2
      1. Log in as an admin on a Moodle 3.2 site.
      2. Create a course (C1) using the weekly format and set the end date to sometime in the future (make a mental note of it).
      3. Create a course (C2) using the weekly format that has no end date (disable the end date field).
      4. Backup both courses.
      5. Restore the courses on a Moodle 3.3 site.
      6. Edit the course C1 and confirm the setting 'Calculate the end date from the number of sections' is disabled and the end date is accurate.
      7. Edit the course C2 and confirm the setting 'Calculate the end date from the number of sections' is enabled.
      Show
      Test 1 Visit a Moodle 3.1 site. Create a course using the weekly format. Backup the course. Visit a Moodle 3.3 site. Ensure debugging is turned on. Restore the course in Moodle 3.3 and ensure there is no PHP error in your apache log. Confirm the setting 'Calculate the end date from the number of sections' for the restored course is enabled. Test 2 Log in as an admin on a Moodle 3.2 site. Create a course (C1) using the weekly format and set the end date to sometime in the future (make a mental note of it). Create a course (C2) using the weekly format that has no end date (disable the end date field). Backup both courses. Restore the courses on a Moodle 3.3 site. Edit the course C1 and confirm the setting 'Calculate the end date from the number of sections' is disabled and the end date is accurate. Edit the course C2 and confirm the setting 'Calculate the end date from the number of sections' is enabled.
    • Affected Branches:
      MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-59076_master

      Description

      When restoring a course backed up by a previous version of Moodle, Moodle 3.3 throws exceptions in the file restore_format_weeks_plugin.class.php due to the absence of a course end date in the backup file. The exceptions aren't displayed in the web page but appear in the apache error log file.

      Steps to repeat:

      1. In Moodle 3.3, as an administrator, restore a course backup created in a previous version of Moodle (3.0 or 3.1 are known to fail - I'm not sure about 3.2).
      2. Check the apache error log.

      The full error traceback is the following (as generated by running the phpunit tests in the CodeRunner plugin, qtype_coderunner_restore_testcase::test_restore)

      Undefined index: enddate

      /var/www/html/moodle/course/format/weeks/backup/moodle2/restore_format_weeks_plugin.class.php:166
      /var/www/html/moodle/backup/moodle2/restore_plugin.class.php:101
      /var/www/html/moodle/backup/util/plan/restore_structure_step.class.php:446
      /var/www/html/moodle/backup/util/plan/restore_task.class.php:106
      /var/www/html/moodle/backup/util/plan/restore_plan.class.php:204
      /var/www/html/moodle/backup/moodle2/restore_final_task.class.php:121
      /var/www/html/moodle/backup/moodle2/restore_stepslib.php:821
      /var/www/html/moodle/backup/util/plan/restore_execution_step.class.php:34
      /var/www/html/moodle/backup/util/plan/base_task.class.php:181
      /var/www/html/moodle/backup/util/plan/base_plan.class.php:178
      /var/www/html/moodle/backup/util/plan/restore_plan.class.php:167
      /var/www/html/moodle/backup/controller/restore_controller.class.php:339
      /var/www/html/moodle/question/type/coderunner/tests/restore_test.php:78
      /var/www/html/moodle/question/type/coderunner/tests/restore_test.php:105
      /var/www/html/moodle/lib/phpunit/classes/advanced_testcase.php:80

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  10/Jul/17