diff --git a/backup/moodle2/restore_stepslib.php b/backup/moodle2/restore_stepslib.php index c34d3490413..e7270333b9c 100644 --- a/backup/moodle2/restore_stepslib.php +++ b/backup/moodle2/restore_stepslib.php @@ -6449,15 +6449,15 @@ trait restore_question_set_reference_data_trait { ) { $newcategoryid = $this->get_mappingid('question_category', $oldcategoryid); $filtercondition['filter']['category']['values'][0] = $newcategoryid; - } - if ($context = $this->get_mappingid('context', $data->questionscontextid)) { - $data->questionscontextid = $context; - } else { - $this->log('question_set_reference with old id ' . $data->id . - ' referenced question context ' . $data->questionscontextid . - ' which was not included in the backup. Therefore, this has been ' . - ' restored with the old questionscontextid.', backup::LOG_WARNING); + if ($context = $this->get_mappingid('context', $data->questionscontextid)) { + $data->questionscontextid = $context; + } else { + $this->log('question_set_reference with old id ' . $data->id . + ' referenced question context ' . $data->questionscontextid . + ' which was not included in the backup. Therefore, this has been ' . + ' restored with the old questionscontextid.', backup::LOG_WARNING); + } } $filtercondition['cat'] = implode(',', [