From: Eloy Lafuente (stronk7) Date: Sat, 9 Jul 2011 17:51:37 +0000 (+0200) Subject: MDL-28156 restore - support restoring files without grade items X-Git-Tag: v2.2.0-beta~729 X-Git-Url: http://git.moodle.org/gw?p=moodle.git;a=commitdiff_plain;h=c8fbcaab1deb310d6835bee01ec4cd3df3c3bc32 MDL-28156 restore - support restoring files without grade items --- diff --git a/backup/moodle2/restore_stepslib.php b/backup/moodle2/restore_stepslib.php index 4a4b1badabf..db7740a58a6 100644 --- a/backup/moodle2/restore_stepslib.php +++ b/backup/moodle2/restore_stepslib.php @@ -323,7 +323,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+##. - list($sql, $params) = $DB->get_in_or_equal(array_values($mappings), SQL_PARAMS_NAMED); + // $mappings can be empty, use 0 if so (won't match ever) + list($sql, $params) = $DB->get_in_or_equal(array_values($mappings), SQL_PARAMS_NAMED, 'param', true, 0); $sql = "SELECT gi.id, gi.calculation FROM {grade_items} gi WHERE gi.id {$sql} AND