Import failure when related contact is a different contact type
In some import mappings, you can't import an Organization as a related contact to an Individual.
Steps to Replicate
- Create a CSV with columns "First Name", "Last Name", and "Employer", with a corresponding row of data.
- On import, map to First Name, Last Name, and "Employee of: Organization Name".
- Import.
Expected Result
2 contacts created.
Actual Result
Import fails, error shows "Mismatched contact type."
This is happening because CRM_Contact_Import_Parser_Contact::lookupContactID()
calls $this->getPossibleContactMatch
and passes the dedupe rule ID selected in the import UI. However, that rule is an Individual dedupe rule, and the related contact is an organization.
Brienne is working on a fix, we'll shout if we run into trouble.