CRM-14961 When deduping, contact sub type doesn't show

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.4.6
    • Fix Version/s: 4.5
    • Component/s: Core CiviCRM
    • Labels:

      Description

      With two individuals, one of no subtype, and one with a subtype, attempt to dedupe them. Witness that although the field is present they are both blank. The same is true of prefix and suffix, but they are both empty on both of the contacts as well. So they shouldn't be appearing here at all.

        Attachments

        1. ContactSubTypeDeduping.png
          34 kB
          John Kirk
        2. Screen Shot 2014-07-16 at 5.02.50 PM.PNG
          103 kB
          David Greenberg
        3. Screen Shot 2014-07-16 at 5.04.15 PM.PNG
          106 kB
          David Greenberg
        4. SubtypeMergeDisplay.PNG
          107 kB
          David Greenberg

          Activity

          [CRM-14961] When deduping, contact sub type doesn't show
          John Kirk added a comment -

          Sorry pal, found a couple of issues, details on the GitHub.

          David Greenberg added a comment -

          Jitendra - Your original PR broke some functionality related to display of custom fields of type File (attachments). Also didn't deal with the fact that contact_sub_type is an array for both 'main' and 'other'.

          I've closed that PR and posted another which does the following:

          • removes 'main_contact_subtype' AND 'other_contact_subtype' from column headers since I don't think it's useful to show only one sub-type when there might be multiples - and we're showing them in the ROWS.
          • partially fixes display of contact_sub_types in $rows and preserves $rows.main/other.fileName display
          • I've corrected the bad code in Merger.php which converts contact_type.name to .label (see lines 202 and 207) - but you'll need to take that approach to convert names to labels in the ARRAY of sub_types provided in $main['contact_sub_type'] and $other['contact_sub_type'].

          https://github.com/civicrm/civicrm-core/pull/3652

          You can review and grab as a patch to continue working on (since it's incomplete). Or merge and then continue w/ a new PR.

          Other than converting names to labels, the MAIN thing left to do is to fix the actual merge of sub_types. As John noted above, it's not handling multiple subType cases at all.

          Jitendra Purohit added a comment -

          created a new PR for labels and merging multiple subtype fix https://github.com/civicrm/civicrm-core/pull/3668

          David Greenberg added a comment -

          This is working much better. Found 3 remaining issues when using the following setup:

          • Create custom data set which is Used For "Parent" contact subtype and create a custom text field (I used "Health Insurer")
          • Create contact with subtypes Parent and Staff and enter a value for the Parent custom field
          • Create a duplicate of that contact - no contact subtype
          • Merge the original (Parent/Staff) contact INTO the Individual contact (see screenshot)

          1. Notice: Undefined offset: 10 in CRM_Dedupe_Merger::moveAllBelongings() (line 1364 of /Users/dgg/git/crm_v4.5/CRM/Dedupe/Merger.php).

          2. Warning at the bottom of the screen seems like it's obsolete and should be removed since we ARE properly moving custom data from the duplicate contact over to the merged contact. ("The duplicate contact (the one that will be deleted) is a Parent, Staff. Any data related to this will be lost forever (there is no undo) if you complete the merge.") Is there a situation where we would still lose data?

          3. "Communication Style" field shows value not label (1 instead of "Formal").

          Jitendra Purohit added a comment -

          Removed the Notice error, Warning and fixed the Communicaton Style label display on the updated PR https://github.com/civicrm/civicrm-core/pull/3668

          Thanks.

          David Greenberg added a comment -

          All noted issues are fixed now. Thanks.

            People

            • Assignee:
              Jitendra Purohit
              Reporter:
              John Kirk

              Dates

              • Created:
                Updated:
                Resolved: