diff --git a/admin/tool/log/backup/moodle2/restore_tool_log_logstore_subplugin.class.php b/admin/tool/log/backup/moodle2/restore_tool_log_logstore_subplugin.class.php index 0c00f00880a..c48c2c86c24 100644 --- a/admin/tool/log/backup/moodle2/restore_tool_log_logstore_subplugin.class.php +++ b/admin/tool/log/backup/moodle2/restore_tool_log_logstore_subplugin.class.php @@ -84,8 +84,7 @@ abstract class restore_tool_log_logstore_subplugin extends restore_subplugin { } } - // Roll dates. - $data->timecreated = $this->apply_date_offset($data->timecreated); + // There is no need to roll dates. Logs are supposed to be immutable. See MDL-44961. // Revert other to its original php way. $data->other = unserialize(base64_decode($data->other)); diff --git a/backup/moodle2/restore_stepslib.php b/backup/moodle2/restore_stepslib.php index c788ac11c82..f88649614f9 100644 --- a/backup/moodle2/restore_stepslib.php +++ b/backup/moodle2/restore_stepslib.php @@ -3089,7 +3089,8 @@ class restore_course_logs_structure_step extends restore_structure_step { $data = (object)($data); - $data->time = $this->apply_date_offset($data->time); + // There is no need to roll dates. Logs are supposed to be immutable. See MDL-44961. + $data->userid = $this->get_mappingid('user', $data->userid); $data->course = $this->get_courseid(); $data->cmid = 0; @@ -3136,7 +3137,8 @@ class restore_activity_logs_structure_step extends restore_course_logs_structure $data = (object)($data); - $data->time = $this->apply_date_offset($data->time); + // There is no need to roll dates. Logs are supposed to be immutable. See MDL-44961. + $data->userid = $this->get_mappingid('user', $data->userid); $data->course = $this->get_courseid(); $data->cmid = $this->task->get_moduleid();