-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
APIv4: Automatically add 'OR IS NULL' to 'NOT CONTAINS' #29402
Conversation
🤖 Thank you for contributing to CiviCRM! ❤️ We will need to test and review this PR. 👷 Introduction for new contributors...
Quick links for reviewers...
|
I'm not sure we need to go with the full IS EMPTY here (which expands into a compound expression like |
56627be
to
945e19d
Compare
Ok ... updated |
@aydun this looks good. Probably a unit test could be added around here:
or here:
|
we just want to know that a particular value is not present but don't care whether the field has any other value or is empty. Add basic tests for CONTAINS and NOT CONTAINS
945e19d
to
10c51ed
Compare
@colemanw Thanks - tests added |
Overview
In APIv4 'NOT CONTAINS', automatically add a 'OR IS NULL' since we just want to know that a particular value is not present but don't care whether the field has any other value or is empty.
Before
WHERE
ofConstituent Information:Most Important Issue
Contains
Education
Doesn't Contain
After
All contacts without 'Education' as the 'Most Important Issue' are returned.
Technical Details
Not sure whether there is a better way to implement this.
Comments
This can be worked around in SK by adding an 'OR' group with 'IS EMPTY' but this is cumbersome.