Merge branch 'MDL-86523-MOODLE_500_STABLE_invalidcategoryid' of https://github.com/loewis/moodle into MOODLE_500_STABLE

This commit is contained in:
Mihail Geshoski
2025-12-02 15:03:57 +08:00
+8 -8
View File
@@ -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(',', [