-
Notifications
You must be signed in to change notification settings - Fork 683
Closed
Labels
Description
What happened?
Description
When querying for entries with an approved generated field, the query will always return zero results. approved is a "binary" (stringified, of course) generated field, and accessing it on the elements themselves individually return the correct results.
When entries querying by this binary field, either by .approved('') or .approved('1') the results will always be [];
Changing the field handle from past tense to a present (approve) will fix the issue. Should approved be a reserved handle?
Steps to reproduce
- Create entry type with
approvedfield handle which returns a "binary" - Ensure you have multiple entries which have this generated field applied.
- Access a single entry, ideally with a truthy value, and ensure that
approvedreturns"1" - Query
craft.entries.approved('').all()orcraft.entries.approved('1').all()and observe[]response. - Change generated field handle to
approve. - Repeat both 3 & 4 with adjusted field handle.
- Observe correctly returned results.
Expected behavior
Returns correct results.
Actual behavior
When entries querying by this binary field, either by .approved('') or .approved('1') the results will always be [];
Craft CMS version
5.8.17
PHP version
8.4
Operating system and version
No response
Database type and version
No response
Image driver and version
No response