Permalink
Browse files

MDL-28156 restore - support restoring files without grade items

  • Loading branch information...
1 parent a938306 commit 3a32daedb5e0a3e90a5c644b4dd7b7d039b455e8 @stronk7 stronk7 committed Jul 9, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 backup/moodle2/restore_stepslib.php
@@ -323,7 +323,8 @@ protected function after_execute() {
// 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

0 comments on commit 3a32dae

Please sign in to comment.