Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-33125: core_backup: Prevent import/activity duplication from dupl…

…icating manual grade items
  • Loading branch information...
commit 5227c9c30512ec048bdefad9c8d9e55c09c33184 1 parent e4592b2
@aolley aolley authored
Showing with 9 additions and 0 deletions.
  1. +9 −0 backup/moodle2/restore_stepslib.php
View
9 backup/moodle2/restore_stepslib.php
@@ -189,6 +189,15 @@ protected function process_grade_item($data) {
$data->id = $newitemid = $existinggradeitem->id;
$DB->update_record('grade_items', $data);
}
+ } else if ($data->itemtype == 'manual') {
+ // Manual items aren't assigned to a cm, so don't go duplicating them in the target if one exists.
+ $gi = array(
+ 'itemtype' => $data->itemtype,
+ 'courseid' => $data->courseid,
+ 'itemname' => $data->itemname,
+ 'categoryid' => $data->categoryid,
+ );
+ $newitemid = $DB->get_field('grade_items', 'id', $gi);
}
if (empty($newitemid)) {
Please sign in to comment.
Something went wrong with that request. Please try again.