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 5d607ef780e..b539a4e60f4 100644 --- a/backup/moodle2/restore_stepslib.php +++ b/backup/moodle2/restore_stepslib.php @@ -3083,7 +3083,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; @@ -3130,7 +3131,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();