Page MenuHomePhabricator

Contribution imported to trashed contact because the contact was merged after data entered in batch
Closed, ResolvedPublic

Description

we got some failmails complaining about "Deleted contact with data found", which is a merged cid https://civicrm.wikimedia.org/civicrm/contact/view?cid=70050236&reset=1 has contribution not moved to the merged to cid https://civicrm.wikimedia.org/civicrm/contact/view?reset=1&cid=67348267

Event Timeline

Had to move over the contribution to the new cid manually, wonder if that's expected or we should move all contribution over when merge cids

Lars added subscribers: Damilare, Lars.

This problem was because the contribution was added to a batch entry import before the contacts were merged and then the batch entry import was processed after the merge happened. So the contact id was already stored in the batch and the contribution was added to the trashed contact. It's not actually a merge problem, it's a batch entry import problem. The one from last week that @Damilare handled was the same problem.

We should be able to add a check on the import hook to make sure the contact isn't trashed and getMergedTo if they are.

Lars renamed this task from Contribution not merged to merged contact to Contribution imported to trashed contact because the contact was merged after data entered in batch.Jan 23 2026, 1:32 AM

Upstream PR, makes sense to fix in core for everyone even if it is probably quite a rare case.

Change #1235162 had a related patch set uploaded (by Lars SG; author: Lars SG):

[wikimedia/fundraising/crm@master] Get merged to contact for batch entry imports, to prevent import to deleted contact

https://gerrit.wikimedia.org/r/1235162

Change #1235162 merged by jenkins-bot:

[wikimedia/fundraising/crm@master] Get merged to contact for batch entry imports, to prevent import to deleted contact

https://gerrit.wikimedia.org/r/1235162

XenoRyet set Final Story Points to 2.