Conditions with null value doesn't get ignore
Bug Description
I am looping collection:items in my code and my Items collection have a boolean field — recommend and I wanted to display all the recommended items when I am visiting /items?recommend=true.
{{ collection:items :recommend:is="get:recommend" }}
...
{{ /collection:items }}
When I am visiting /items?recommend=true, the condition :recommend:is="get:recommend" works fine. But when I visit /items, the condition :recommend:is="get:recommend" does not get ignore when get:recommend return null, instead it shows items that is not recommend — recommend = false
How to Reproduce
- Add filter
:recommend:is="get:recommend"in a collection tag - Visit the route without any params
- The collection return on the page is records that
failthe condition:recommend:is="get:recommend"
Extra Detail
Forum conversation:
- https://statamic.com/forum/4869-url-query-in-collections-tag
Environment
Statamic version: 3.0.9 Pro Laravel version: 7.28.1 PHP version: 7.4.10
Install method (choose one):
- Fresh install from
statamic/statamic
This issue has not had recent activity and has been marked as stale — by me, a robot. Simply reply to keep it open and send me away. If you do nothing, I will close it in a week. I have no feelings, so whatever you do is fine by me.