Querying an entry by a lightswitch value stopped working for both true and false values.
craft.entries.section('pages').isFeatured(true)true, and isFeatured=false) as the generated query is AND (NOT ("content"."field_isFeatured" IS NULL))What happens when you query using:
craft.entries.section('pages').isFeatured('not 1')
craft.entries.section('pages').isFeatured('0')
Same result for 1, '1', true/false, 'not 1' etc. @jonleverrier
Edit: Weird, this worked before in 3.3.6 but after updating to 3.3.7, and reverting back to 3.3.6, did not solve the issue. See below.
I've verified this is happening only when using Postgres.
Last tested working version is 3.3.3, version 3.3.4 had the same issue as MySQL which was fixed in 3.3.4.1, but from there on Postgres queries are unable to search by lightswitch at all.
Hope this can be fixed in the next release. Downgrading to 3.3.3 is a solution until that time.
Can confirm this is the case. This seems to be related to recent changes in how lightswitch works by @brandonkelly
Just fixed this for the next release. We鈥檒l get that out ASAP, but if you need it right away, change your craftcms/cms requirement in composer.json to:
"require": {
"craftcms/cms": "dev-develop#600e937048d83dc2ae6498a348b9f47aab064f35 as 3.3.7",
"...": "..."
}
Then run composer update.
Most helpful comment
Just fixed this for the next release. We鈥檒l get that out ASAP, but if you need it right away, change your
craftcms/cmsrequirement in composer.json to:Then run
composer update.