Merge branch 'MDL-63284-master' of https://github.com/Clyxz/moodle
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Mon, 1 Jun 2020 22:25:04 +0000 (00:25 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Mon, 1 Jun 2020 22:25:04 +0000 (00:25 +0200)
lib/questionlib.php

index 859e424..470b3be 100644 (file)
@@ -560,7 +560,7 @@ function question_move_question_tags_to_new_context(array $questions, context $n
     $questionstagobjects = core_tag_tag::get_items_tags('core_question', 'question', $questionids);
 
     foreach ($questions as $question) {
-        $tagobjects = $questionstagobjects[$question->id];
+        $tagobjects = $questionstagobjects[$question->id] ?? [];
 
         foreach ($tagobjects as $tagobject) {
             $tagid = $tagobject->taginstanceid;