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

Importing contact custom data doesn't respect the Fill option

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.6.4, 4.6.5
    • Fix Version/s: 4.7.27
    • Component/s: Import
    • Labels:
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code

      Description

      Selecting the Fill option for a contact import, which should skip over a data field if there's already a value in it, doesn't for custom data. I duplicated this with the John Smith record on the demo site using the Most Important Issue, Marital Status and Gender fields. The first two were overwritten by the import, but the last one wasn't.

      http://d46.demo.civicrm.org/civicrm/contact/view?reset=1&cid=202

      I'll try to attach the CSV I used after submitting the ticket; I'm getting a 500 error trying to attach it here.

      The relevant code is in CRM/Contact/Import/Parser/Contact.php, line 1752

            elseif ($customFieldId = CRM_Core_BAO_CustomField::getKeyID($key)) {
              $custom = TRUE;
            }
      

      I'm not completely sure what this part of the conditional is doing. I rewrote this in a hacky way to get this fixed for my immediate need, but it's not committable. I can provide a patch with a little more context and guidance about the above section of the code.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jlacey Joseph Lacey
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: