Contact merge does not move audit log entries to the surviving contact
Mautic Series
7.1.x series
Mautic installed version
7.1
Way of installing
I downloaded a release from https://www.mautic.org/mautic-releases
PHP version
8.3
What browsers are you seeing the problem on?
No response
What happened?
When two contacts are merged, some contact-related records are reassigned from the losing contact to the surviving contact, but audit_log entries are not updated. As a result, the surviving contact’s audit log is incomplete after the merge, while historical audit entries remain attached to the deleted/losing contact ID.
Expected behavior
After merging contact A into contact B, all audit log entries for contact A should be reassigned to contact B, so the surviving contact shows the full combined audit history.
Actual behavior
Only some related records are moved during merge. Audit log rows with:
bundle = 'lead' object = 'lead' object_id = remain linked to the losing contact ID and are no longer visible on the surviving contact’s audit log tab.
Impact
Users lose visibility into historical contact changes after a merge. This makes merged contact records harder to audit and can hide important history such as field updates, identification events, IP additions, and other contact changes.
How can we reproduce this issue?
Step 1: Create a contact A Step 2: Edit it Step 3: See the audit log Step 4: Create a form Step 5: Fill out the form with the email address of contact A Step 6: After submitting, check that the leads got merged and that the Audit log of A is gone (your edit from step2), but the history is still there
Relevant log output
Code of Conduct
- I confirm that I have read and agree to follow this project's Code of Conduct
Care about this issue? Want to get it resolved sooner? If you are a member of Mautic, you can add some funds to the Bounties Project so that the person who completes this task can claim those funds once it is merged by a member of the core team! Read the docs here.
Source: mautic/mautic