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

APIv3 - Fix overzealous pseudoconstant matching #22298

Merged
merged 2 commits into from
Dec 23, 2021

Conversation

colemanw
Copy link
Member

Overview

Fixes regression caused by #22282.

Before

An api3 call like this would fail due to strict case matching:

civicrm_api3('CustomGroup', 'get', [
  'extends' => "contact",
]);

After

Works fine. SQL is case-insensitive so there's no reason not to allow it.

Technical Details

Strings do not need to be strictly matched to pseudoconstants during get operations.

Strings do not need to be strictly matched to pseudoconstants
during get operations.

Fixes regression caused by civicrm#22282.
@civibot
Copy link

civibot bot commented Dec 22, 2021

(Standard links)

@seamuslee001
Copy link
Contributor

test fails relate IMO @colemanw

@colemanw
Copy link
Member Author

Ok, I've fixed one test by throwing the expected API_Error in that particular function. The other two tests were IMO just plain bad. They were testing a quirk of the APIv3 Contact Query Object which they expected to fail in a particular way and now it doesn't. But I see no reason why it should have failed that way, and all other tests are passing. So I removed them.

@colemanw
Copy link
Member Author

Retest this please

1 similar comment
@colemanw
Copy link
Member Author

Retest this please

@colemanw
Copy link
Member Author

@seamuslee001 it's passing now

@eileenmcnaughton eileenmcnaughton merged commit f00390e into civicrm:master Dec 23, 2021
@eileenmcnaughton eileenmcnaughton deleted the fixApi3ValidateString branch December 23, 2021 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants