ethercreative / tags

A tag manager for Craft 3
Other
22 stars 9 forks source link

Fixing issue 18, tags not appearing after craftcms/cms@636f778 #19

Closed stevecomrie closed 3 years ago

stevecomrie commented 3 years ago

Not 100% sure if this is the right way to fix the issue, but this gets the job done given the recent element type filtering introduced in craftcms/cms@636f778

Hopefully it's at least a road map toward a more elegant solution.

Resolves #18

benatleith commented 3 years ago

This also works (in ether\tagManager\elements\db\TagQuery)

public static function find (): ElementQueryInterface { return new TagQuery('craft\elements\Tag'); }

edit: this will get the tag list working but it's not a fix for the underlying element type issue.

stevecomrie commented 3 years ago

This also works (in ether\tagManager\elements\db\TagQuery)

public static function find (): ElementQueryInterface { return new TagQuery('craft\elements\Tag'); }

There's the elegant solution that I knew had to exist but was eluded by my ham fists.

alanski66 commented 3 years ago

public static function find (): ElementQueryInterface { return new TagQuery('craft\elements\Tag'); } Lovely solution - wish i understood it better!

For anyone seeking to implement meestaben's solution above it goes in Tag.php vendor/ether/tags/src/elements/Tag.php

stevecomrie commented 3 years ago

I did just notice that while meestaben's solution does work, there is a small difference in that tags that are editable do not show up as having a blue underline in the UI.

Where as with my solution they do.

Not sure what's causing that or if it's the only side-effect but just something to keep in mind in-case anyone notices anything else that isn't quite working properly.