Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Cannot Reproduce
-
Affects Version/s: 4.2.0
-
Fix Version/s: 4.3.0
-
Component/s: Core CiviCRM
-
Labels:
Description
When importing contacts, a custom field with select (also probably Multi-Select and ADVMulti-Select) is included and that field matches via case-insensitive match but does NOT match case-sensitive match, the entire record is silently dropped from the import without giving and error message.
This bug is similar to http://issues.civicrm.org/jira/browse/CRM-10832 and the cause appears to be similar. Looking at /CRM/Import/Parser/Contact.php:
1. There is a validation step and an import step. The validation step accepts case-insensitive matches but the import step rejects them (silently).
2. Errors on the import step ( are just ignored and not displayed or logged anywhere. This makes it difficult to troubleshoot errors that happen.
I think problem #1 can be fixed by removing the strtolower statements in this line of /CRM/Import/Parser/Contact.php (around line 1210):
if ((strtolower(trim($v2['label'])) == strtolower(trim($v1))) || (strtolower(trim($v2['value'])) == strtolower(trim($v1)))) {
$flag = TRUE;
Similarly around line 1227:
if ((strtolower(trim($v2['label'])) == strtolower(trim($value))) || (strtolower(trim($v2['value'])) == strtolower(trim($value))))
{ $flag = TRUE; }(I haven't had a chance to try this or troubleshoot it, however-there are some other lines with strtolower in the file and some might be OK while others are not. On the import, custom data with case mismatch is skipped-I'm not sure what happens to other data with case mismatch.)