Merge branch 'wip-mdl-43306-m' of git://github.com/rajeshtaneja/moodle
authorDan Poltawski <dan@moodle.com>
Mon, 20 Jan 2014 01:45:43 +0000 (09:45 +0800)
committerDan Poltawski <dan@moodle.com>
Mon, 20 Jan 2014 01:45:43 +0000 (09:45 +0800)
1  2 
backup/moodle2/restore_stepslib.php

@@@ -2223,7 -2223,6 +2223,7 @@@ class restore_calendarevents_structure_
          $result = $DB->record_exists_sql($sql, $arg);
          if (empty($result)) {
              $newitemid = $DB->insert_record('event', $params);
 +            $this->set_mapping('event', $oldid, $newitemid);
              $this->set_mapping('event_description', $oldid, $newitemid, $restorefiles);
          }
  
@@@ -2833,6 -2832,12 +2833,12 @@@ class restore_activity_grades_structure
          }
          // no need to save any grade_letter mapping
      }
+     public function after_restore() {
+         // Fix grade item's sortorder after restore, as it might have duplicates.
+         $courseid = $this->get_task()->get_courseid();
+         grade_item::fix_duplicate_sortorder($courseid);
+     }
  }