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

Membership import completely fails data validation if the default dedupe rule involves custom data which does not extend memberships

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 3.3.3, 3.3.4
    • Fix Version/s: Unscheduled
    • Component/s: CiviMember, Core CiviCRM
    • Labels:
      None

      Description

      Background:
      I am using custom data to extend the individual contact records and a default strict dedupe rule that relies on three of these fields. For obscure and annoying organisational reasons, the membership import has to use the same CSV file as the contact import, so the contacts have to be matched with this dedupe rule, rather than their internal contact ID.

      After maually applying the fix for CRM-7332 so that the custom fields could be used, I have now found that another fix was needed to avoid errors about missing required fields (see last comment on CRM-7332) but now, the data comes up with errors at the next step, where every one of the 200-ish records has this:
      "Invalid value for field(s) : field ID; ; field ID; ; field ID; "

      This seems to be caused by line 1089 of /CRM/Import/Parser/Contact.php:
      if ( !array_key_exists($customFieldID, $customFields)) {
      where $customFields is an empty array. The problem is that the fields that I am matching on are an extension to the individual contact type, but line 1084:
      $customFields = CRM_Core_BAO_CustomField::getFields( $params['contact_type'], false, false, $csType );
      is passing 'Membership' as the contact type and therefore saying that there are no custom data fields to import to.

      I would have expected that it would be possible to use some fields to match on without actually importing them as part of the membership record. I could create custom fields to extend the membership, but then I'd be pointlessly duplicating the info held in the contact record.

        Attachments

          Activity

            People

            • Assignee:
              deepak Deepak Srivastava
              Reporter:
              mattgibson Matt Gibson
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: