MDL-63284 question: Moving questions with tags disabled bug fix
authorMartin Hanusch <martin.hanusch@let.ethz.ch>
Fri, 29 May 2020 14:42:04 +0000 (16:42 +0200)
committerMartin Hanusch <martin.hanusch@let.ethz.ch>
Fri, 29 May 2020 14:42:04 +0000 (16:42 +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;