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

APIv4 - Smarter check for adding default ON clause to explicit joins #19275

Merged
merged 1 commit into from
Dec 28, 2020

Conversation

colemanw
Copy link
Member

Overview

Allows greater flexibility in how explicit joins are performed in APIv4

See https://lab.civicrm.org/dev/core/-/issues/2271

Before

Default ON clause added to any join without an ID specified already in its clauses.

After

Default ON clause added to any join without an ID OR an FK field specified.

Technical Details

When adding explicit joins in APIv4, the API will automacially add an ON clause linking it to the base entity unless it detects some other link already present in the ON clause supplied.
Previously it would determine this by checking for the join entity ID;
Now it looks for the join entity ID OR any other field in the join entity with an FK.
This gives more leeway for people to add creative joins without the defaults getting in the way.

@civibot
Copy link

civibot bot commented Dec 24, 2020

(Standard links)

@civibot civibot bot added the master label Dec 24, 2020
… explicit joins

When adding explicit joins in APIv4, the API will automacially add an ON clause linking it
to the base entity unless it detects some other link already present in the ON clause supplied.
Previously it would determine this by checking for the join entity ID;
now it looks for the join entity ID OR any other field in the join entity with an FK.
This gives more leeway for people to add creative joins without the defaults getting in the way.
@eileenmcnaughton eileenmcnaughton merged commit a4b487a into civicrm:master Dec 28, 2020
@eileenmcnaughton eileenmcnaughton deleted the apiJoinConditions branch December 28, 2020 21:57
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.

2 participants