From 019e98e16bceed7d0889b3ba3e5b71de4ab717cf Mon Sep 17 00:00:00 2001 From: Steve Comrie Date: Tue, 28 Sep 2021 02:38:09 -0400 Subject: [PATCH] Fixing issue 18, tags not appearing after craftcms/cms@636f778 --- src/elements/db/TagQuery.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/elements/db/TagQuery.php b/src/elements/db/TagQuery.php index bceaddf..fbb1e79 100644 --- a/src/elements/db/TagQuery.php +++ b/src/elements/db/TagQuery.php @@ -23,6 +23,15 @@ class TagQuery extends \craft\elements\db\TagQuery protected function afterPrepare (): bool { + // due to the introduction of type filtering in element queries (see:https://github.com/craftcms/cms/discussions/9806) + // we have to make sure that the query is filtering based on 'craft\elements\Tag' and not 'ether\tagManager\elements\Tag' + for($i = 0; $i <= count($this->subQuery->where); $i++) { + if( !empty($this->subQuery->where[$i]['elements.type']) ) { + $this->subQuery->where[$i]['elements.type'] = 'craft\elements\Tag'; + break; + } + } + if (Craft::$app->getDb()->getDriverName() === 'mysql') return parent::afterPrepare();