Details
-
Type:
Improvement
-
Status: Done/Fixed
-
Priority:
Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.0.8
-
Fix Version/s: 4.1.0
-
Component/s: Core CiviCRM
-
Labels:None
Description
Problems:
1. Currently no hook is fired when restoring a contact from trash.
2. Also, the 'delete' operation is passed to pre and post hooks at two different times: when moving a contact to trash, AND when permanently deleting a trashed contact.
Proposed solutions:
1. This patch addresses item 1 by adding 'trash' and 'restore' operations for pre and post hooks.
2. This doesn't attempt to address item 2; a more complete solution will be – I suggest – to stop firing the hooks with 'delete' operation when sending contact to trash, and only use that op when permanently deleting the contact; but this raises backwards-compatibility concerns, so I'm not trying to address it here. So with this patch, these hooks are still called with 'delete' op upon trashing a contact, but now they're also called with the 'trash' op at that time.
Previous patch was passing the Contact DAO object as 4th param in call to the pre hook, whereas the pre hook is expecting an array here. Now passing CRM_Core_DAO::$_nullArray