- Issue created by @sadashiv
- 🇮🇳India sadashiv
Submitted a pr at https://github.com/eileenmcnaughton/civicrm_entity/pull/507
The enabled components check implemented improves unecessary code execution on acitivity create/update afte the mail send which improves the sending speed.
Thanks,
Sadashiv. - 🇺🇸United States markusa
@sadashiv
There is a setting to disable pre/post hooks on the settings page already.
I'm considering adding another to disable pre/post hooks if the entity type is not "enabled"
"Enabled" only means that CE provides Manage Fields, Manage Forms, Manage Display configurations for an entity type, and the possibility of Drupal based versions of add/edit/delete forms and view pages.
Pre / Post hooks fire to trigger Drupal based entity CRUD hooks/events, which some people may want. For instance Rules integration depends on this.
We're thinking this over.
- 🇮🇳India sadashiv
Hi Mark,
I did see that we have the option to disable hooks, but if we do that it will disable the entity sync for all civicrm entities, which may not be desired.
What I did in the PR is check whether the civicrm entity sync is turned on, example I have it on for civicrm contact and off for other entities, then in case of mail send when civicrm core creates a Acitivity, we won't be invoking the load, etc code written in the pre and post hooks, as the sync is disabled for activities. This is a lot of performance improvement.
Thanks,
Sadashiv.