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 unnecessary event #23311

Merged
merged 2 commits into from
Apr 28, 2022
Merged

Conversation

colemanw
Copy link
Member

Overview

Makes it easier for extensions to hook into APIv4 entities by simplifying the events called.

Before

To implement a virtual API4 entity, an extension must listen to 2 events, one of which is redundant.

After

Redundant event no longer used, as the one event returns all necessary data.

Technical Details

All the info from civi.api4.entityTypes is sufficient to create an APIv4 request.
civi.api4.createRequest was redundant.

@civibot
Copy link

civibot bot commented Apr 27, 2022

(Standard links)

@civibot civibot bot added the master label Apr 27, 2022
@colemanw
Copy link
Member Author

@jensschuppe I confirmed that the unit tests in ECK are still passing after this change.

@seamuslee001
Copy link
Contributor

This seems fine to me

@eileenmcnaughton
Copy link
Contributor

unit tests might be on board but the style police aren't.... https://test.civicrm.org/job/CiviCRM-Core-PR/48340/checkstyle/

jensschuppe added a commit to systopia/de.systopia.eck that referenced this pull request Apr 27, 2022
The "civi.api4.createRequest" event will be removed in CiviCRM Core, see civicrm/civicrm-core#23311. The "civi.api4.entityTypes" event provides all necessary information.
jensschuppe added a commit to systopia/de.systopia.eck that referenced this pull request Apr 27, 2022
When civicrm/civicrm-core#23311 is merged, this event listener will be obsolete
colemanw added a commit to colemanw/de.systopia.eck that referenced this pull request Apr 27, 2022
Keeping it around for now, but not requiring the class to prevent errors when it gets removed from core.
See civicrm/civicrm-core#23311
Before: To implement a virtual API4 entity, an extension must listen to 2 events, one of which is redundant.
After: Redundant event no longer used, as the one event returns all necessary data.

All the info from `civi.api4.entityTypes` is sufficient to create an APIv4 request.
`civi.api4.createRequest` was redundant.
Filtering out component entities at a low level was causing errors when trying
to get basic info about an entity from a disabled component.
It's better to do the filtering in the Entity.get action instead.
@seamuslee001 seamuslee001 merged commit a43ee4b into civicrm:master Apr 28, 2022
@seamuslee001 seamuslee001 deleted the unusedEvent branch April 28, 2022 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants