From 95ef9d8095737755b974e16eee6e6b4db2d6ddf0 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Tue, 17 Mar 2015 14:33:38 +0000 Subject: [PATCH] MDL-49547 question restore: avoid tag-related notices. --- backup/moodle2/restore_stepslib.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backup/moodle2/restore_stepslib.php b/backup/moodle2/restore_stepslib.php index 209f97d75f1..91cf6628f2c 100644 --- a/backup/moodle2/restore_stepslib.php +++ b/backup/moodle2/restore_stepslib.php @@ -3892,6 +3892,11 @@ class restore_create_categories_and_questions extends restore_structure_step { $data = (object)$data; $newquestion = $this->get_new_parentid('question'); + $questioncreated = (bool) $this->get_mappingid('question_created', $this->get_old_parentid('question')); + if (!$questioncreated) { + // This question already exists in the question bank. Nothing for us to do. + return; + } if (!empty($CFG->usetags)) { // if enabled in server // TODO: This is highly inefficient. Each time we add one tag