MDL-58822 backup: backup and restore new event columns
authorRyan Wyllie <ryan@moodle.com>
Mon, 8 May 2017 02:14:02 +0000 (02:14 +0000)
committerRyan Wyllie <ryan@moodle.com>
Tue, 9 May 2017 05:48:40 +0000 (05:48 +0000)
backup/moodle2/backup_stepslib.php
backup/moodle2/restore_stepslib.php

index 596259e..acdf34b 100644 (file)
@@ -863,8 +863,9 @@ class backup_calendarevents_structure_step extends backup_structure_step {
 
         $event = new backup_nested_element('event', array('id'), array(
                 'name', 'description', 'format', 'courseid', 'groupid', 'userid',
-                'repeatid', 'modulename', 'instance', 'eventtype', 'timestart',
-                'timeduration', 'visible', 'uuid', 'sequence', 'timemodified'));
+                'repeatid', 'modulename', 'instance', 'type', 'eventtype', 'timestart',
+                'timeduration', 'timesort', 'visible', 'uuid', 'sequence', 'timemodified',
+                'priority'));
 
         // Build the tree
         $events->add_child($event);
index 89b1592..b23fda4 100644 (file)
@@ -2657,7 +2657,6 @@ class restore_calendarevents_structure_step extends restore_structure_step {
         // both a modulename and instance value set.
         $isuseroverride = !$data->courseid && $data->modulename && $data->instance;
 
-
         // If we don't want to include user data and this record is a user override event
         // for an activity then we should not create it.
         if (!$this->task->get_setting_value('userinfo') && $isuseroverride) {
@@ -2706,13 +2705,16 @@ class restore_calendarevents_structure_step extends restore_structure_step {
                 'userid'         => $data->userid,
                 'repeatid'       => $this->get_mappingid('event', $data->repeatid),
                 'modulename'     => $data->modulename,
+                'type'           => $data->type,
                 'eventtype'      => $data->eventtype,
                 'timestart'      => $this->apply_date_offset($data->timestart),
                 'timeduration'   => $data->timeduration,
+                'timesort'       => $this->apply_date_offset($data->timesort),
                 'visible'        => $data->visible,
                 'uuid'           => $data->uuid,
                 'sequence'       => $data->sequence,
-                'timemodified'    => $this->apply_date_offset($data->timemodified));
+                'timemodified'   => $this->apply_date_offset($data->timemodified),
+                'priority'       => $data->priority);
         if ($this->name == 'activity_calendar') {
             $params['instance'] = $this->task->get_activityid();
         } else {