Skip to content

Commit 019e98e

Browse files
committed
Fixing issue 18, tags not appearing after craftcms/cms@636f778
1 parent ce4155b commit 019e98e

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/elements/db/TagQuery.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ class TagQuery extends \craft\elements\db\TagQuery
2323

2424
protected function afterPrepare (): bool
2525
{
26+
// due to the introduction of type filtering in element queries (see:https://github.com/craftcms/cms/discussions/9806)
27+
// we have to make sure that the query is filtering based on 'craft\elements\Tag' and not 'ether\tagManager\elements\Tag'
28+
for($i = 0; $i <= count($this->subQuery->where); $i++) {
29+
if( !empty($this->subQuery->where[$i]['elements.type']) ) {
30+
$this->subQuery->where[$i]['elements.type'] = 'craft\elements\Tag';
31+
break;
32+
}
33+
}
34+
2635
if (Craft::$app->getDb()->getDriverName() === 'mysql')
2736
return parent::afterPrepare();
2837

0 commit comments

Comments
 (0)