mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 18:06:51 +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
|
@ -53,9 +53,10 @@ class restore_choice_activity_structure_step extends restore_activity_structure_
|
|||
$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->timeopen = $this->apply_date_offset($data->timeopen);
|
||||
$data->timeclose = $this->apply_date_offset($data->timeclose);
|
||||
$data->timemodified = $this->apply_date_offset($data->timemodified);
|
||||
|
||||
// insert the choice record
|
||||
$newitemid = $DB->insert_record('choice', $data);
|
||||
|
@ -70,7 +71,6 @@ class restore_choice_activity_structure_step extends restore_activity_structure_
|
|||
$oldid = $data->id;
|
||||
|
||||
$data->choiceid = $this->get_new_parentid('choice');
|
||||
$data->timemodified = $this->apply_date_offset($data->timemodified);
|
||||
|
||||
$newitemid = $DB->insert_record('choice_options', $data);
|
||||
$this->set_mapping('choice_option', $oldid, $newitemid);
|
||||
|
@ -84,7 +84,6 @@ class restore_choice_activity_structure_step extends restore_activity_structure_
|
|||
$data->choiceid = $this->get_new_parentid('choice');
|
||||
$data->optionid = $this->get_mappingid('choice_option', $data->optionid);
|
||||
$data->userid = $this->get_mappingid('user', $data->userid);
|
||||
$data->timemodified = $this->apply_date_offset($data->timemodified);
|
||||
|
||||
$newitemid = $DB->insert_record('choice_answers', $data);
|
||||
// No need to save this mapping as far as nothing depend on it
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue