Skip to content
Browse files

Merge branch 'wip-mdl-33455-m22' of git://github.com/rajeshtaneja/moo…

…dle into MOODLE_22_STABLE
  • Loading branch information...
2 parents bc861f5 + 33db7d7 commit 092e389f4fe5c8b709004a490f5fc1eb8073908c @nebgor nebgor committed Jun 5, 2012
Showing with 12 additions and 9 deletions.
  1. +12 −9 backup/moodle2/restore_stepslib.php
View
21 backup/moodle2/restore_stepslib.php
@@ -211,15 +211,18 @@ protected function process_grade_grade($data) {
$data->itemid = $this->get_new_parentid('grade_item');
$data->userid = $this->get_mappingid('user', $data->userid, NULL);
- $data->usermodified = $this->get_mappingid('user', $data->usermodified, NULL);
- $data->locktime = $this->apply_date_offset($data->locktime);
- // TODO: Ask, all the rest of locktime/exported... work with time... to be rolled?
- $data->overridden = $this->apply_date_offset($data->overridden);
- $data->timecreated = $this->apply_date_offset($data->timecreated);
- $data->timemodified = $this->apply_date_offset($data->timemodified);
-
- $newitemid = $DB->insert_record('grade_grades', $data);
- //$this->set_mapping('grade_grade', $oldid, $newitemid);
+ if (!is_null($data->userid)) {
+ $data->usermodified = $this->get_mappingid('user', $data->usermodified, NULL);
+ $data->locktime = $this->apply_date_offset($data->locktime);
+ // TODO: Ask, all the rest of locktime/exported... work with time... to be rolled?
+ $data->overridden = $this->apply_date_offset($data->overridden);
+ $data->timecreated = $this->apply_date_offset($data->timecreated);
+ $data->timemodified = $this->apply_date_offset($data->timemodified);
+
+ $newitemid = $DB->insert_record('grade_grades', $data);
+ } else {
+ debugging("Mapped user id not found for grade item id '{$data->itemid}'");
+ }
}
protected function process_grade_category($data) {
global $DB;

0 comments on commit 092e389

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