Hi there,
Deleting a contact in the CiviCRM UI does not actually delete the entity. It simply just sets a flag, "is_deleted", to 1. The only time the entity should be completely removed is when the contact is purged from the trash.
When the contact is initially moved to the trash, this should fire an update event - because that flag has changed.
When the contact is purged from the trash, this is when the rules delete event should fire.
We could argue that the rules event placement is sufficient due to the context of the action occurring in CiviCRM. But I'd disagree seeing as what should actually be happening within the entity is an update event, strictly speaking.
This issue is causing drama with a real time integration project I'm running.
Comment | File | Size | Author |
---|---|---|---|
#2 | Issue-2413469-by-strainyy-Rules-Delete-Event-Specified-Incorrectly-2.patch | 1.67 KB | strainyy |
Comments
Comment #1
strainyy CreditAttribution: strainyy commentedAfter some digging, I can see now that this is actually a CiviCRM Core issue, trash and delete operations are fired concurrently when implementing hook_civicrm_post. I've created a new issue to try to address this on the CiviCRM-side, open to work-arounds however.
https://issues.civicrm.org/jira/browse/CRM-15868
Comment #2
strainyy CreditAttribution: strainyy commentedThis should do the trick.
Comment #3
strainyy CreditAttribution: strainyy commentedComment #5
eileenmcnaughton CreditAttribution: eileenmcnaughton commentedOK - I'm accepting this & committing it - although looks like I should have used the commit message below to get the attribution right (sorry).
I have some misgivings about the effect on existing sites - but this is going out in the 2.x (which we should take out of dev soon) so I guess that mitigates that somewhat.
Note sure where this would be best documented
Comment #6
eileenmcnaughton CreditAttribution: eileenmcnaughton commentedI added a note on the main project page under 'upgrade notes'