diff --git a/ext/auto_tagger/main.php b/ext/auto_tagger/main.php index dc2a7d000..b3bdc00c2 100644 --- a/ext/auto_tagger/main.php +++ b/ext/auto_tagger/main.php @@ -152,17 +152,16 @@ public function onTagSet(TagSetEvent $event): void { error_log("auto-tagger: tag set!"); foreach($event->new_tags as $nt) { - error_log("new tag: ".$nt); + error_log("auto-tagger: new tag: ".$nt); } foreach($event->old_tags as $ot) { - error_log("old tag: ".$ot); + error_log("auto-tagger: old tag: ".$ot); } foreach($event->metatags as $mt) { - error_log("meta tag: ".$mt); + error_log("auto-tagger: meta tag: ".$mt); } $results = $this->apply_auto_tags($event->new_tags); if (!empty($results)) { - $event->new_tags = $results; error_log("auto-tagger: checking results for metatags..."); # need to check tags again for metatags foreach ($results as $r) { @@ -170,9 +169,12 @@ public function onTagSet(TagSetEvent $event): void $ttpe = send_event(new TagTermCheckEvent($r)); //seperate tags from metatags - if ($ttpe->metatag) { - error_log($r." is a meta tag!"); - $this->metatags[] = $r; + if (!$ttpe->metatag) { + $event->new_tags = $r; + error_log("auto-tagger: ".$r." is a normal tag."); + } else { + error_log("auto-tagger: ".$r." is a meta tag!"); + $event->metatags[] = $r; } } }