Permalink
Browse files

Merge branch 'MDL-37161-moodle22' of https://github.com/StudiUM/moodle

…into MOODLE_22_STABLE
  • Loading branch information...
Sam Hemelryk
Sam Hemelryk committed Jan 7, 2013
2 parents e6f5bd2 + d14e5a7 commit 4e805e91c791d6dbbbe2e83fa61fc66d3735cd97
Showing with 7 additions and 2 deletions.
  1. +7 −2 backup/moodle2/restore_stepslib.php
@@ -296,8 +296,13 @@ protected function process_grade_setting($data) {
$data->courseid = $this->get_courseid();
- $newitemid = $DB->insert_record('grade_settings', $data);
- //$this->set_mapping('grade_setting', $oldid, $newitemid);
+ if (!$DB->record_exists('grade_settings', array('courseid' => $data->courseid, 'name' => $data->name))) {
+ $newitemid = $DB->insert_record('grade_settings', $data);
+ } else {
+ $newitemid = $data->id;
+ }
+
+ $this->set_mapping('grade_setting', $oldid, $newitemid);
}
/**

0 comments on commit 4e805e9

Please sign in to comment.