-
-
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
[REF] APIv4 - Dispatch event during Entity.get #21803
Conversation
(Standard links)
|
d70d040
to
4d5845f
Compare
I wonder is this PR will help with the apiv4 getfields caching bug that has stymied me here #21790 |
4d5845f
to
ed4b782
Compare
@eileenmcnaughton yea, the functional change here is that previously there were 2 incomplete caches - a cache of entity classes, and a cache of (partial) entity info. It was lazier that way but not necessarily more efficient. This new way is IMO better - it does the whole scan once and caches a single array of all entities and their complete info. |
@colemanw style
|
This allows extensions to modify the list of entities, enabling "virtual" entities not based on php files.
ed4b782
to
0b2471a
Compare
Grr, it's that stupid |
Tests are passing and they passed against our test suite too |
@@ -26,6 +26,7 @@ public function setUp(): void { | |||
'created_date' => 'first sat of July 2008', | |||
]; | |||
parent::setUp(); | |||
\CRM_Core_BAO_ConfigSetting::enableComponent('CiviCampaign'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, this failed because CampaignTest
neglected to enable the CiviCampaign
component!
Overview
This allows extensions to modify the list of entities, enabling "virtual" entities not based on php files.
Followup to #21771
Before
Assumptions made about entities belonging in files.
After
Entity retrieval and caching refactored to call an event.
Technical Details
I had to refactor the part that fetches custom groups because using the api within API.entity.get was causing recursion.
Comments
I submitted this against 5.43 because #21771 is in 5.43 and it would be best to have them together.