numero2 / contao-tags

Adds the possibility to assign tags to individual elements.
GNU Lesser General Public License v3.0
1 stars 3 forks source link

Error "Undefined constant" #8

Closed jaynoe closed 6 months ago

jaynoe commented 6 months ago

Got an Error in Contao 5.3 when using the NewsList with filtered tags.

Undefined constant "numero2\TagsBundle\BE_USER_LOGGED_IN"

I corrected the lines in the TagsRelModel class - but i´m not sure whether all this is right and sensible. Got some infos from https://docs.contao.org/dev/reference/services/#security-helper and have corrected the class so that the error in the frontend is gone.

bennyborn commented 6 months ago

I don't think this is the right way. We solely rely on the Cores Model::isPreviewMode method which takes care of all the checks. And looking at the current 5.3 I'm not even sure why BE_USER_LOGGED_IN should be used at all:

https://github.com/contao/contao/blob/18035dde308007bd8f83bfa9c3f0fb10264d6d23/core-bundle/contao/library/Contao/Model.php#L1392-L1407

bennyborn commented 6 months ago

Could it be that you haven't tested the latest version (0.2.0)? Prior to this we did use BE_USER_LOGGED_IN but it has since been changed to the Core's Model::isPreviewMode.

jaynoe commented 6 months ago

Oh sorry my mistake. I thought i was on the latest version but was locked on v0.1.

So all good, thanks for the feedback.