From 327c88b76bf9c7047c718e2f194b88dbd8a58e9c Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Sat, 9 Jul 2011 19:51:37 +0200 Subject: [PATCH] MDL-28156 restore - support restoring files without grade items --- backup/moodle2/restore_stepslib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backup/moodle2/restore_stepslib.php b/backup/moodle2/restore_stepslib.php index 6f41077f0d9..905190a6528 100644 --- a/backup/moodle2/restore_stepslib.php +++ b/backup/moodle2/restore_stepslib.php @@ -312,6 +312,8 @@ class restore_gradebook_structure_step extends restore_structure_step { // We need to update the calculations for calculated grade items that may reference old // grade item ids using ##gi\d+##. + // $mappings can be empty, use 0 if so (won't match ever) + $mappings = !empty($mappings) ? $mappings : array(0); list($sql, $params) = $DB->get_in_or_equal(array_values($mappings), SQL_PARAMS_NAMED); $sql = "SELECT gi.id, gi.calculation FROM {grade_items} gi