Skip to content
Browse files

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

…into MOODLE_23_STABLE
  • Loading branch information...
2 parents 178a5b4 + d71792d commit fc77cb3d85278200d49ffa803934ca169d10ca10 Sam Hemelryk committed Jan 7, 2013
Showing with 7 additions and 2 deletions.
  1. +7 −2 backup/moodle2/restore_stepslib.php
View
9 backup/moodle2/restore_stepslib.php
@@ -297,8 +297,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 fc77cb3

Please sign in to comment.
Something went wrong with that request. Please try again.