Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-37378 quiz restore: timecheckstate not in old backups.

We need to avoid a notice. If the value is missing, setting it to 0 is
fine. It will get sorted out the next time cron is run.
  • Loading branch information...
commit df0c2e5fd3ac2a92f5c6db92cc6fc00b88ad8f09 1 parent dbee98b
@timhunt timhunt authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 mod/quiz/backup/moodle2/restore_quiz_stepslib.php
View
6 mod/quiz/backup/moodle2/restore_quiz_stepslib.php
@@ -306,7 +306,11 @@ protected function process_quiz_attempt($data) {
$data->timestart = $this->apply_date_offset($data->timestart);
$data->timefinish = $this->apply_date_offset($data->timefinish);
$data->timemodified = $this->apply_date_offset($data->timemodified);
- $data->timecheckstate = $this->apply_date_offset($data->timecheckstate);
+ if (!empty($data->timecheckstate)) {
+ $data->timecheckstate = $this->apply_date_offset($data->timecheckstate);
+ } else {
+ $data->timecheckstate = 0;
+ }
// Deals with up-grading pre-2.3 back-ups to 2.3+.
if (!isset($data->state)) {
Please sign in to comment.
Something went wrong with that request. Please try again.