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

Merging contacts: 'add new' checkbox can refer to wrong entity

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.6.10, 4.7
    • Fix Version/s: 4.6.11, 4.7
    • Component/s: None
    • Labels:
    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code

      Description

      When merging contacts that have telephone numbers and email addresses, the 'add new' operation checkbox initially refers to the correct field.

      However, if you change the location types to an empty type (eg: home to work), to remove the 'add new' checkbox, and then change it back to the original again:
      The checkbox no longer refers to the correct field: all checkboxes refer to the 'last' location field on the page.

      This is because the 'mergeBlock' javascript function is defined under every location element - and is therefore overwritten - and the code for the 'add new' checkbox is hardcoded into it.

      This will be fixed in CRM-17556 for 4.7

      And I'll do a backport for 4.6 afterwards.

      Steps to recreate on d46:

      • Create a new dedupe rule for individuals based on just 'last name'
      • Run the rule
      • Choose two contacts to merge that have an email address and a phone field to merge
      • Notice that the email address appears first, and has a correct 'add new' checkbox: input#location[email][1][operation]
      • Change the 'location' of the email to 'work' and back to 'home'
      • Notice that the email address 'add new' checkbox now refers to: input#location[*phone*][1][operation]
      • Thus unexpected results occur, and incorrect fields can be overwritten/added

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dgg David Greenberg
                Reporter:
                john John K.
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: