You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since updating to Craft 5.7, using the 'not 1' syntax for Lightswitch element query params no longer works as expected – i.e. instead of returning elements that doesn't have the Lightswitch field enabled, it now does the opposite and only returns elements where the Lightswitch field is enabled.
FWIW, I know that the 'not 1' syntax isn't actually mentioned in the Lightswitch docs, so this might be an intended change to remove a behavior that hasn't actually been officially supported for a while. Still feels like a breaking change, though.
Steps to reproduce
Create some entries using an entry type that includes a Lightswitch field. Make sure some entries have the Lightswitch field set to enabled, and others to disabled.
What happened?
Description
Since updating to Craft 5.7, using the
'not 1'
syntax for Lightswitch element query params no longer works as expected – i.e. instead of returning elements that doesn't have the Lightswitch field enabled, it now does the opposite and only returns elements where the Lightswitch field is enabled.FWIW, I know that the
'not 1'
syntax isn't actually mentioned in the Lightswitch docs, so this might be an intended change to remove a behavior that hasn't actually been officially supported for a while. Still feels like a breaking change, though.Steps to reproduce
Create some entries using an entry type that includes a Lightswitch field. Make sure some entries have the Lightswitch field set to enabled, and others to disabled.
Execute the following element query:
On Craft 5.6.17, this query will return any entry that doesn't have the
lightswitchField
enabled.On Craft 5.7.1.1, this query will return entries that does have the
lightswitchField
enabled.Expected behavior
Querying elements using
'not 1'
for a Lightswitch element query param should return elements that doesn't have the Lightswitch enabled.Actual behavior
Elements that have the Lightswitch field enabled are returned.
Craft CMS version
5.7.1.1
PHP version
8.3.19
Operating system and version
DDEV v1.24.4
Database type and version
MySQL 8.0.40
Image driver and version
No response
Installed plugins and versions
None
The text was updated successfully, but these errors were encountered: