Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 3.2.1
-
Fix Version/s: 3.2.2
-
Component/s: Core CiviCRM
-
Labels:None
Description
When merging two contacts, if the duplicate contact has an External ID value, the merge breaks. Reproducible on sandbox:
http://drupal.demo.civicrm.org/civicrm/contact/merge?reset=1&cid=156&oid=157
Select all and merge.
The merge script uses sql UPDATE to transfer the value from record 1 to 2. But a unique value constraint on external_identifier prohibits transfer of that value to the retained record.
UPDATE civicrm_contact SET contact_type = 'Individual' , external_identifier = 'jd1' WHERE ( civicrm_contact.id = 156 )
Database Error Code: Duplicate entry 'jd2' for key 2, 1062
maybe the value can be stored in a temp var until the dup contact is deleted, then transferred to the retained record.