-
Bug
-
Resolution: Fixed
-
Major
-
3.11.6, 3.11.7, 4.0.1
-
MOODLE_311_STABLE, MOODLE_400_STABLE
-
MOODLE_311_STABLE, MOODLE_400_STABLE
-
On build 20220315:
Attempt to import an activity from one course to another.
Traceback:
[30-Mar-2022 11:02:58 Pacific/Auckland] Default exception handler: Exception - array_values(): Argument #1 ($array) must be of type array, null given Debug:
Error code: generalexceptionmessage
- line 687 of /availability/classes/tree.php: TypeError thrown
- line 687 of /availability/classes/tree.php: call to array_values()
- line 323 of /availability/classes/info.php: call to core_availability\tree->update_after_restore()
- line 926 of /backup/moodle2/restore_stepslib.php: call to core_availability\info->update_after_restore()
- line 34 of /backup/util/plan/restore_execution_step.class.php: call to restore_update_availability->define_execution()
- line 181 of /backup/util/plan/base_task.class.php: call to restore_execution_step->execute()
- line 191 of /backup/util/plan/base_plan.class.php: call to base_task->execute()
- line 168 of /backup/util/plan/restore_plan.class.php: call to base_plan->execute()
- line 394 of /backup/controller/restore_controller.class.php: call to restore_plan->execute()
- line 193 of /backup/import.php: call to restore_controller->execute_plan()
It seems this must be a bug rather than "just" duff data, as core_availability\info->update_after_restore() has just created a new tree, which uses decode_availability, which is supposed to either discard invalid data or throw an exception.
Attempting to replicate the problem on a dev instance, backing up and then restoring the course did complete successfully. Restoring the same backup onto the original prod instance did not succeed.
- has a non-specific relationship to
-
MDL-18177 Add option to choose whether groups and/or groupings are includedin a back up
- Closed