Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.x] Improves "where" modifier value check #10681

Merged

Conversation

JohnathonKoster
Copy link
Contributor

@JohnathonKoster JohnathonKoster commented Aug 22, 2024

This PR closes #10679 by only applying the default == operator if the number of supplied parameters is less than 3.

@JonKaric
Copy link
Contributor

JonKaric commented Aug 22, 2024

Looks like a if the value is passed in as a string instead, it still breaks.

Should these two work in the exact same way, as we aren't strict checking?
where('product_count', '!=', '0')
where('product_count', '!=', 0)

@JohnathonKoster
Copy link
Contributor Author

Good catch. I've refactored the approach to only apply the default condition if the supplied number of params is less than 3

@jasonvarga jasonvarga merged commit 40a62c1 into statamic:5.x Aug 22, 2024
17 checks passed
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.

Sending 0 to where modifier gives unexpected results
3 participants