Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-37676 Use course grade category if mapping fails for manual grade…

… items
  • Loading branch information...
commit 05b733703c1aae6011320bdc09058d7b435fa7b6 1 parent 373a8e0
@woolardfa woolardfa authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 backup/moodle2/restore_stepslib.php
View
5 backup/moodle2/restore_stepslib.php
@@ -150,6 +150,11 @@ protected function process_grade_item($data) {
if ($data->itemtype=='manual') {
// manual grade items store category id in categoryid
$data->categoryid = $this->get_mappingid('grade_category', $data->categoryid, NULL);
+ // if mapping failed put in course's grade category
+ if (NULL == $data->categoryid) {
+ $coursecat = grade_category::fetch_course_category($this->get_courseid());
+ $data->categoryid = $coursecat->id;
+ }
} else if ($data->itemtype=='course') {
// course grade item stores their category id in iteminstance
$coursecat = grade_category::fetch_course_category($this->get_courseid());
Please sign in to comment.
Something went wrong with that request. Please try again.