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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0.3, 2.1, 2.2
    • Fix Version/s: 2.0.4, 2.1.1
    • Component/s: Backup
    • Labels:
    • Testing Instructions:
      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
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      restore_gradebook_in_or_equal_master

      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()

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    1/Aug/11