Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-18455

'Safe merge' contacts designed to change address location type on conflict

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.7.6
    • Fix Version/s: None
    • Component/s: None
    • Documentation Required?:
      None
    • Sprint:
      MergeSprint1
    • Funding Source:
      Contributed Code

      Description

      Currently the code is designed to automatically change the location type of an address if there is a conflict during a merge - even using safe mode.

      The code: https://github.com/civicrm/civicrm-core/blob/a5c2116e1af3395eee5fa327cfa0d3230249b3f1/CRM/Dedupe/Merger.php#L852

      This seems to be saying:
      If there is a 'home' address on both records.
      Then go through all the possible location types for addresses and effectively pick one at random (that isn't used on the main contact). Assign the address as that type and put it on the main contact.

      This is not very good logic as the type of address is obviously quite important (home, work, etc.).

      I propose that a 'safe' merge should always throw a conflict in the case of addresses - don't randomly try to assign a new location.

      This still matches the logic in the UI that says a contact can only have one address of each type still.

        Attachments

          Activity

            People

            • Assignee:
              john John K.
              Reporter:
              john John K.
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: