Permalink
Browse files

MDL-28156 restore - support restoring files without grade items

  • Loading branch information...
1 parent 89b2800 commit 327c88b76bf9c7047c718e2f194b88dbd8a58e9c @stronk7 stronk7 committed Jul 9, 2011
Showing with 2 additions and 0 deletions.
  1. +2 −0 backup/moodle2/restore_stepslib.php
@@ -312,6 +312,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+##.
+ // $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

0 comments on commit 327c88b

Please sign in to comment.