MDL-61410 question: Check we have tags to set to avoid notices
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Wed, 21 Mar 2018 13:55:39 +0000 (14:55 +0100)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Wed, 21 Mar 2018 13:55:39 +0000 (14:55 +0100)
question/format.php

index 6e00169..08689f5 100644 (file)
@@ -445,7 +445,7 @@ class qformat_default {
                                 $importingcontext, $question->tags);
                         }
                     }
-                } else {
+                } else if (!empty($question->tags)) {
                     core_tag_tag::set_item_tags('core_question', 'question', $question->id,
                         $question->context, $question->tags);
                 }