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

Case mismatch on custom data date/boolean import leads to silent drop of entire record

    Details

      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.)

        Attachments

          Activity

            People

            • Assignee:
              yashodha Yashodha Chaku
              Reporter:
              bhugh Brent Hugh
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: