Skip to content

Conversation

@ryanmitchell
Copy link
Contributor

@ryanmitchell ryanmitchell commented Feb 8, 2024

This is a second go at this and is an alternative to / replaces #8357

This PR adds an overlaps modifier and tag condition, as well as a doesnt_overlap tag condition. The Modifier is intentionally a loose comparison, so if any of the values in needle are found it counts as a match. This is to mirror how whereJsonOverlaps() works on the builder side.

Closes statamic/ideas#910

@ryanmitchell ryanmitchell changed the title [4.x] Add includes condition and modifier [4.x] Add includes and doesnt_include conditions and modifiers Feb 8, 2024
@ryanmitchell ryanmitchell changed the title [4.x] Add includes and doesnt_include conditions and modifiers [4.x] Add includes and doesnt_include conditions and includes modifier Feb 8, 2024
@afonic
Copy link

afonic commented Feb 10, 2024

Good job! This is very useful and will solve not being able to filter by any field that gets saved by an array (like multiple select, checkboxes etc).

@robdekort
Copy link
Contributor

This is very useful, and seems to work like a charm. I ran into a Statamic limitation and @afonic pointed me to your PR Ryan. Thanks both.

@robdekort
Copy link
Contributor

Jason do you reckon this will make the cut someday and I can patch it in? Otherwise I'll work on a query scope instead.

@jasonvarga
Copy link
Member

do you reckon this will make the cut someday

More than likely, but not 100% sure.

@robdekort
Copy link
Contributor

Gotcha. Thanks Jason.

@jacksleight
Copy link
Contributor

Nice! This will close statamic/ideas#910

@ryanmitchell ryanmitchell changed the base branch from 4.x to 5.x May 10, 2024 10:04
@ryanmitchell ryanmitchell changed the title [4.x] Add includes and doesnt_include conditions and includes modifier [5.x] Add includes and doesnt_include conditions and includes modifier May 10, 2024
@ryanmitchell ryanmitchell changed the title [5.x] Add includes and doesnt_include conditions and includes modifier [5.x] Add includes and doesnt_include conditions and modifiers May 20, 2024
@ryanmitchell ryanmitchell mentioned this pull request Jul 30, 2024
1 task
@jasonvarga jasonvarga self-assigned this Aug 22, 2024
@jasonvarga
Copy link
Member

I wonder how this lines up with #11117 / #11112 now.

@ryanmitchell
Copy link
Contributor Author

I guess it could be overlaps/doesnt_overlap now?

@ryanmitchell ryanmitchell changed the title [5.x] Add includes and doesnt_include conditions and modifiers [5.x] Add overlaps and doesnt_overlap conditions and modifiers Aug 8, 2025
@ryanmitchell
Copy link
Contributor Author

@jasonvarga thanks for merging #11112 - I've updated this to be overlaps/doesnt_overlap now.

@jasonvarga jasonvarga merged commit 16d22d7 into statamic:5.x Aug 8, 2025
24 checks passed
@ryanmitchell ryanmitchell deleted the feature/add-includes-condition-and-modifier branch August 8, 2025 15:38
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.

Tag conditions for whereJsonContains and whereJsonDoesntContain

5 participants