Skip to content

Commit

Permalink
MDL-28156 restore - support restoring files without grade items
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Jul 9, 2011
1 parent a938306 commit 3a32dae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backup/moodle2/restore_stepslib.php
Expand Up @@ -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
Expand Down

0 comments on commit 3a32dae

Please sign in to comment.