MDL-9367 restore: Roll only configuration dates

It was decided to roll only configuration dates and any date related to user content
such as 'timecreated' , 'timemodified' etc should not be rolled forward.
This commit is contained in:
Ankit Agarwal 2017-06-29 13:38:47 +05:30
parent d509f80c48
commit 0d14fcbc60
57 changed files with 1617 additions and 74 deletions

View file

@ -60,6 +60,8 @@ class restore_forum_activity_structure_step extends restore_activity_structure_s
$oldid = $data->id;
$data->course = $this->get_courseid();
// Any changes to the list of dates that needs to be rolled should be same during course restore and course reset.
// See MDL-9367.
$data->assesstimestart = $this->apply_date_offset($data->assesstimestart);
$data->assesstimefinish = $this->apply_date_offset($data->assesstimefinish);
if ($data->scale < 0) { // scale found, get mapping
@ -83,7 +85,6 @@ class restore_forum_activity_structure_step extends restore_activity_structure_s
$data->course = $this->get_courseid();
$data->forum = $this->get_new_parentid('forum');
$data->timemodified = $this->apply_date_offset($data->timemodified);
$data->timestart = $this->apply_date_offset($data->timestart);
$data->timeend = $this->apply_date_offset($data->timeend);
$data->userid = $this->get_mappingid('user', $data->userid);
@ -101,8 +102,6 @@ class restore_forum_activity_structure_step extends restore_activity_structure_s
$oldid = $data->id;
$data->discussion = $this->get_new_parentid('forum_discussion');
$data->created = $this->apply_date_offset($data->created);
$data->modified = $this->apply_date_offset($data->modified);
$data->userid = $this->get_mappingid('user', $data->userid);
// If post has parent, map it (it has been already restored)
if (!empty($data->parent)) {
@ -148,8 +147,6 @@ class restore_forum_activity_structure_step extends restore_activity_structure_s
}
$data->rating = $data->value;
$data->userid = $this->get_mappingid('user', $data->userid);
$data->timecreated = $this->apply_date_offset($data->timecreated);
$data->timemodified = $this->apply_date_offset($data->timemodified);
// We need to check that component and ratingarea are both set here.
if (empty($data->component)) {