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

Fatal Error when backing up/restoring backup file created from empty course

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.0.3, 2.1, 2.2
    • 2.0.4, 2.1.1
    • Backup
    • MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • MOODLE_20_STABLE, MOODLE_21_STABLE
    • restore_gradebook_in_or_equal_master
    • Easy
    • Hide

      IMPORTANT: It's critical to test this twice. Once under 20_STABLE and another under 21_STABLE (no need for master testing as far as solution is 100% the 21_STABLE one).

      1) Create a new course, fill in the course settings
      2) Don't add any new activities
      3) Backup course
      4) Attempt to restore the course
      5) TEST: No notices/warnings shown along the whole process (specially pages 1 and 3 in the restore process
      6) TEST: Restore ends OK and you get one 100% empty (no activities) course at the end

      Show
      IMPORTANT: It's critical to test this twice. Once under 20_STABLE and another under 21_STABLE (no need for master testing as far as solution is 100% the 21_STABLE one). 1) Create a new course, fill in the course settings 2) Don't add any new activities 3) Backup course 4) Attempt to restore the course 5) TEST: No notices/warnings shown along the whole process (specially pages 1 and 3 in the restore process 6) TEST: Restore ends OK and you get one 100% empty (no activities) course at the end

    Description

      I created a backup file from a course with nothing in it (see attached files), then got:

      Coding error detected, it must be fixed by a programmer: moodle_database::get_in_or_equal() does not accept empty arrays

      More information about this error

      Stack trace:
      line 582 of /lib/dml/moodle_database.php: coding_exception thrown
      line 326 of /backup/moodle2/restore_stepslib.php: call to moodle_database->get_in_or_equal()
      line 359 of /backup/util/plan/restore_structure_step.class.php: call to restore_gradebook_structure_step->after_execute()
      line 108 of /backup/util/plan/restore_structure_step.class.php: call to restore_structure_step->launch_after_execute_methods()
      line 153 of /backup/util/plan/base_task.class.php: call to restore_structure_step->execute()
      line 148 of /backup/util/plan/base_plan.class.php: call to base_task->execute()
      line 157 of /backup/util/plan/restore_plan.class.php: call to base_plan->execute()
      line 302 of /backup/controller/restore_controller.class.php: call to restore_plan->execute()
      line 144 of /backup/util/ui/restore_ui.class.php: call to restore_controller->execute_plan()
      line 45 of /backup/restore.php: call to restore_ui->execute()

      Attachments

        Issue Links

          Activity

            People

              stronk7 Eloy Lafuente (stronk7)
              poltawski Dan Poltawski
              Sam Hemelryk Sam Hemelryk
              Andrew Davis Andrew Davis
              Adrian Greeve, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                1/Aug/11