Merge branch 'm27_MDL-47076' of git://github.com/totara/moodle into MOODLE_27_STABLE

This commit is contained in:
Marina Glancy
2014-09-09 17:13:09 +08:00
+12
View File
@@ -2114,7 +2114,13 @@ class restore_badges_structure_step extends restore_structure_step {
$data = (object)$data;
$data->usercreated = $this->get_mappingid('user', $data->usercreated);
if (empty($data->usercreated)) {
$data->usercreated = $this->task->get_userid();
}
$data->usermodified = $this->get_mappingid('user', $data->usermodified);
if (empty($data->usermodified)) {
$data->usermodified = $this->task->get_userid();
}
// We'll restore the badge image.
$restorefiles = true;
@@ -2211,6 +2217,12 @@ class restore_badges_structure_step extends restore_structure_step {
'issuerrole' => $role,
'datemet' => $this->apply_date_offset($data->datemet)
);
// Skip the manual award if recipient or issuer can not be mapped to.
if (empty($award['recipientid']) || empty($award['issuerid'])) {
return;
}
$DB->insert_record('badge_manual_award', $award);
}
}