Skip to content

Commit

Permalink
MDL-44961 logs: Keep log dates constant during restore
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitagarwal committed Jun 14, 2017
1 parent 4c6063b commit a4beef4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ protected function process_log($data) {
}
}

// 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));
Expand Down
6 changes: 4 additions & 2 deletions backup/moodle2/restore_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -3083,7 +3083,8 @@ protected function process_log($data) {

$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;
Expand Down Expand Up @@ -3130,7 +3131,8 @@ protected function process_log($data) {

$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();
Expand Down

0 comments on commit a4beef4

Please sign in to comment.