Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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 816138b4f20713dda5f695ba9db40f80acf8f071 1 parent 2e5d013
Tim Hunt timhunt authored

Showing 1 changed file with 5 additions and 1 deletion. Show diff stats Hide diff stats

  1. +5 1 mod/quiz/backup/moodle2/restore_quiz_stepslib.php
6 mod/quiz/backup/moodle2/restore_quiz_stepslib.php
@@ -306,7 +306,11 @@ protected function process_quiz_attempt($data) {
306 306 $data->timestart = $this->apply_date_offset($data->timestart);
307 307 $data->timefinish = $this->apply_date_offset($data->timefinish);
308 308 $data->timemodified = $this->apply_date_offset($data->timemodified);
309   - $data->timecheckstate = $this->apply_date_offset($data->timecheckstate);
  309 + if (!empty($data->timecheckstate)) {
  310 + $data->timecheckstate = $this->apply_date_offset($data->timecheckstate);
  311 + } else {
  312 + $data->timecheckstate = 0;
  313 + }
310 314
311 315 // Deals with up-grading pre-2.3 back-ups to 2.3+.
312 316 if (!isset($data->state)) {

0 comments on commit 816138b

Please sign in to comment.
Something went wrong with that request. Please try again.