mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
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:
parent
d509f80c48
commit
0d14fcbc60
57 changed files with 1617 additions and 74 deletions
|
@ -55,14 +55,14 @@ class restore_data_activity_structure_step extends restore_activity_structure_st
|
|||
$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->timeavailablefrom = $this->apply_date_offset($data->timeavailablefrom);
|
||||
$data->timeavailableto = $this->apply_date_offset($data->timeavailableto);
|
||||
$data->timeviewfrom = $this->apply_date_offset($data->timeviewfrom);
|
||||
$data->timeviewto = $this->apply_date_offset($data->timeviewto);
|
||||
$data->assesstimestart = $this->apply_date_offset($data->assesstimestart);
|
||||
$data->assesstimefinish = $this->apply_date_offset($data->assesstimefinish);
|
||||
// Added in 3.1, hence conditional.
|
||||
$data->timemodified = isset($data->timemodified) ? $this->apply_date_offset($data->timemodified) : time();
|
||||
|
||||
if ($data->scale < 0) { // scale found, get mapping
|
||||
$data->scale = -($this->get_mappingid('scale', abs($data->scale)));
|
||||
|
@ -98,9 +98,6 @@ class restore_data_activity_structure_step extends restore_activity_structure_st
|
|||
$data = (object)$data;
|
||||
$oldid = $data->id;
|
||||
|
||||
$data->timecreated = $this->apply_date_offset($data->timecreated);
|
||||
$data->timemodified = $this->apply_date_offset($data->timemodified);
|
||||
|
||||
$data->userid = $this->get_mappingid('user', $data->userid);
|
||||
$data->groupid = $this->get_mappingid('group', $data->groupid);
|
||||
$data->dataid = $this->get_new_parentid('data');
|
||||
|
@ -137,8 +134,6 @@ class restore_data_activity_structure_step extends restore_activity_structure_st
|
|||
}
|
||||
$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)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue