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

Importing custom fields with Null breaks during call to deprecated api

    Details

    • Type: Patch
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.1.5
    • Fix Version/s: 4.3.0
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      Issue with treatment of NULL values during import of contacts related to custom fields.

      If there is a single custom field present as NULL in the CSV file, specifying the mapping doesn't make a difference to the import. The contact is imported successfully.

      Issue arises when there are multiple custom fields and any one of them has a NULL value. The entire record is skipped and nothing is updated without generating an error message.

      After debugging, found that the error is being generated due to a typecheck on the value of the custom field being imported. The process is being aborted at the following LOC: 1670 of CRM/Import/Parser/Contact.php

      A check on the value of the custom field is being done by a function in the file 'api/v3/DeprecatedUtils.php'. The question thus arises, is the check being done right owing to the file being a part of a deprecated set of functions?

      Currently applied a workaround by unsetting NULL values before parsing the custom fields. Please find the patch attached.

        Attachments

        1. Contact.diff
          1 kB
          Joe Murray
        2. CRM-11034.diff
          1 kB
          Joe Murray

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              joemurray Joe Murray
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: