diff --git a/docs/hooks/hook_civicrm_post.md b/docs/hooks/hook_civicrm_post.md index 29d947745392a3919bccf2f0760215c90b4b1ea4..4c468f2cef2265fec9a240b18888828d81cfa44b 100644 --- a/docs/hooks/hook_civicrm_post.md +++ b/docs/hooks/hook_civicrm_post.md @@ -14,7 +14,9 @@ deleted first). !!! note These hooks use database transactions. Don't execute code that updates the same data in the database without using a callback. Eg. if triggering on a `Membership` entity, don't try and update that membership entity within the hook. Use CRM_Core_Transaction::addCallback() instead. - + +!!! tip + Some of the more esoteric entities may not fire this hook when they're saved. If you happen to find such an entity, please make a PR to core which adds this hook. As an example, you can refer to `CRM_Core_BAO_Dashboard::create()` to find succinct syntax that appropriately calls both `CRM_Utils_Hook::pre()` and `CRM_Utils_Hook::post()`. ## Definition @@ -65,6 +67,7 @@ hook_civicrm_post($op, $objectName, $objectId, &$objectRef) expressed an interest to perform an action when a profile is created/edited)* - 'Relationship' + - 'Survey' (from 5.1.x) - 'Tag' - 'UFMatch' *(when an object is linked to a CMS user record, at the request of GordonH. A UFMatch object is passed for both the pre diff --git a/docs/hooks/hook_civicrm_pre.md b/docs/hooks/hook_civicrm_pre.md index c2bb9d71bef64b69c661e00534cc76f67efae6bc..d3237626ceed9e2ad1f7169f1b3a4a81e240d467 100644 --- a/docs/hooks/hook_civicrm_pre.md +++ b/docs/hooks/hook_civicrm_pre.md @@ -15,6 +15,9 @@ constraints etc (when deleting an object, the child objects have to be deleted first). Another good use for the pre hook is to see what is changing between the old and new data. +!!! tip + Some of the more esoteric entities may not fire this hook when they're saved. If you happen to find such an entity, please make a PR to core which adds this hook. As an example, you can refer to `CRM_Core_BAO_Dashboard::create()` to find succinct syntax that appropriately calls both `CRM_Utils_Hook::pre()` and `CRM_Utils_Hook::post()`. + ## Definition hook_civicrm_pre($op, $objectName, $id, &$params) @@ -35,32 +38,33 @@ changing between the old and new data. objects only) - $objectName - can have the following values: + - 'Activity' + - 'Campaign' (from 4.6) + - 'Contribution' + - 'ContributionRecur' + - 'CustomGroup' + - 'EntityTag' (from 4.7.16) + - 'Event' - 'Individual' - 'Household' - - 'Organization' - 'Group' - 'GroupContact' - - 'Relationship' - - 'Activity' - - 'Contribution' - - 'Profile' (while this is not really an object, people have - expressed an interest to perform an action when a profile is - created/edited) - 'Membership' - 'MembershipPayment' - 'MessageTemplate' - - 'Event' + - 'Organization' - 'Participant' - 'ParticipantPayment' + - 'Pledge' + - 'PledgePayment' + - 'Profile' (while this is not really an object, people have + expressed an interest to perform an action when a profile is + created/edited) + - 'Relationship' + - 'Survey' (from 5.1.x) - 'UFMatch' (when an object is linked to a CMS user record, at the request of GordonH. A UFMatch object is passed for both the pre and post hooks) - - PledgePayment - - ContributionRecur - - Pledge - - CustomGroup - - 'Campaign' (from 4.6) - - 'EntityTag' (from 4.7.16) **