Skip to content

Commit

Permalink
Merge pull request #19 from stevecomrie/issue-18-patch
Browse files Browse the repository at this point in the history
Fixing issue 18, tags not appearing after craftcms/cms@636f778
  • Loading branch information
Tam authored Oct 4, 2021
2 parents ce4155b + 019e98e commit 81d3825
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/elements/db/TagQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 81d3825

Please sign in to comment.