What happened?
Description
Not conditions aren't working until a checkbox field value has been modified.
Steps to reproduce
- Create a checkbox field with two options, all unchecked by default.
- Assign field to an entry type/section.
- Create a new entry and save. Don't select any checkbox fields.
- Using the filters/conditions in the element index (or using a Twig query) create a not one of query. Note behavior.
- Within created entry, check an option, and save. The uncheck all options and save.
- Do the same query again and not behavior.
Note we are using Twig with craft.entries.section('handle').myField(['not', 'optionA'])
Expected behavior
Newly created entry appears at step 4.
Actual behavior
Newly created entry doesn't appear.
This makes not queries with checkboxes a little brittle and leads to unexpected behavior depending on if a checkbox has other options selected to the one being excluded.
Craft CMS version
5.10.4
PHP version
8.4.20
Operating system and version
No response
Database type and version
MySQL 8.0.40
Image driver and version
No response
Installed plugins and versions
What happened?
Description
Not conditions aren't working until a checkbox field value has been modified.
Steps to reproduce
Note we are using Twig with
craft.entries.section('handle').myField(['not', 'optionA'])Expected behavior
Newly created entry appears at step 4.
Actual behavior
Newly created entry doesn't appear.
This makes not queries with checkboxes a little brittle and leads to unexpected behavior depending on if a checkbox has other options selected to the one being excluded.
Craft CMS version
5.10.4
PHP version
8.4.20
Operating system and version
No response
Database type and version
MySQL 8.0.40
Image driver and version
No response
Installed plugins and versions