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 - Deprecate Entity::getLinks action #20727

Merged
merged 2 commits into from
Jul 5, 2021

Conversation

colemanw
Copy link
Member

@colemanw colemanw commented Jun 30, 2021

Overview

Deprecates an obscure APIv4 action which was only used in one place (the Explorer).
Updates the APIv4 Explorer to not use it and to display it as deprecated.

image

Technical Details

The action returns a bunch of deprecated information which is not useful.
The APIv4 Explorer had been using a small portion of the info which was actually redundant with existing info from getFields.

@civibot
Copy link

civibot bot commented Jun 30, 2021

(Standard links)

@civibot civibot bot added the master label Jun 30, 2021
@colemanw colemanw force-pushed the deprecateApi4EntityLinks branch from 1c72856 to eb1f650 Compare July 4, 2021 02:05
colemanw added 2 commits July 4, 2021 13:41
The action returns a bunch of deprecated information which is no longer needed.
The APIv4 Explorer had been using a small portion of it which was actually redundant
with existing info from getFields.
@colemanw colemanw force-pushed the deprecateApi4EntityLinks branch from eb1f650 to 61fbf33 Compare July 4, 2021 17:41
@eileenmcnaughton
Copy link
Contributor

OK - I definitely can''t see any more getlinks calls going on in universe - I'm struggling to make sense of the removed getBackReferences function to agree or not agree on removing that.

@colemanw
Copy link
Member Author

colemanw commented Jul 5, 2021

I'm struggling to make sense of the removed getBackReferences function to agree or not agree on removing that.

When APIv4 was in its infancy there was a very different idea about how joins would work, which involved a second query behind-the-scenes to fetch e.g. multiple activities per contact, and a syntax like 'select' => ['contact.activities.subject']. That's all been ripped out in favor of the new explicit join syntax, so these backreferences to generate links like "contact.activities" are obsolete and unused. Currently it's just wasting CPU cycles every time you call the api.

@eileenmcnaughton
Copy link
Contributor

OK @colemanw

@eileenmcnaughton eileenmcnaughton merged commit 2e61bca into civicrm:master Jul 5, 2021
@eileenmcnaughton eileenmcnaughton deleted the deprecateApi4EntityLinks branch July 5, 2021 22:21
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