Skip to content

Document ['not', 'foo', 'bar'] for checkboxes and multi-select queries - #808

Closed
alvaroalonsoparrondo-a11y wants to merge 1 commit into
craftcms:mainfrom
alvaroalonsoparrondo-a11y:checkboxes-not-query
Closed

alvaroalonsoparrondo-a11y wants to merge 1 commit into
craftcms:mainfrom
alvaroalonsoparrondo-a11y:checkboxes-not-query

Conversation

@alvaroalonsoparrondo-a11y

Copy link
Copy Markdown
Contributor

Fixes #760.

In Craft 5, BaseOptionsField::queryCondition() handles the not operator for multi-value fields: it turns the values into an or condition, negates it, and also keeps elements with no value. So ['not', 'foo', 'bar'] returns elements that have neither option. This adds that row to the query tables for Checkboxes and Multi-select in the 5.x docs.

4.x is left alone, since BaseOptionsField there does not handle not for these fields.

@alvaroalonsoparrondo-a11y
alvaroalonsoparrondo-a11y requested a review from a team as a code owner November 24, 2026 21:31
@netlify

netlify Bot commented Nov 24, 2026

Copy link
Copy Markdown

👷 Deploy request for craft-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 7925eab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Content]: Missing syntax example: ['not', 'foo', 'bar']

2 participants