Merging contacts removes case roles
Overview
When you merge contacts and and the old and new contact had both a role on two different cases with the same client. One of the roles gets deleted.
Reproduction steps
- Click on Contacts -> New Individual.
- Entered First Name (John) and Last Name (Doe) and click Save.
- Click on Contacts -> New Individual.
- Entered First Name (Tom) and Last Name (Smith) and click Save.
- Click on Contacts -> New Individual.
- Entered First Name (Smith) and Last Name (Tom) and click Save.
- Click on Case -> New Case
- Select Housing Support as Case type and John Doe as Client and enter Case 1 as Subject
- On the manage case screen select Tom Smith as Health Service Coordinator
- Click on Case -> New Case
- Select Housing Support as Case type and John Doe as Client and enter Case 2 as Subject
- On the manage case screen select Smith Tom as Health Service Coordinator
- Merge Tom Smith and Smith Tom
Current behaviour
The role Health Service Coordinator gets deleted from one of the cases.
Expected behaviour
The merged contact should have two roles on two cases.
Environment information
- CiviCRM: _Master/5.29.1/5.30.0
- PHP: _7.3
- CMS: _Drupal 7/Wordpress 5
Comments
This is caused by the fact that the merged basically ends up with two the same relationships (Health Service Coordinator) for the same client but they are on two different cases.