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.