Details
-
Type: Improvement
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Won't Fix
-
Affects Version/s: 3.1.3
-
Fix Version/s: 3.2
-
Component/s: Core CiviCRM
-
Labels:None
Description
When importing contact data (CSV) which includes relationship data and where some of the records may be missing required/important relationship data, the import process will create an empty contact and set up an empty relationship.
The case in point was that we were trying to import a CSV file that had basic contact data such as first_name, last_name, email, job_title and also a field titled employer. When setting up the mapping we mapped the "employer" field to "Employee Of => Organization Name". However, only about 50% of the records actually had any data in the "employer" field. After the import we discovered that for those records CiviCRM had created an empty contact record of type Organization and related it to the respective contact. Not only is wrong logically, but in the interface since there was no data in the contact record it was difficult to actually get to the empty record because there was no information to click on, so you can see it but can't really access it except via the MySQL directly.
The attached patch demonstrably corrected this issue for the use case mentioned above, but has not been tested with other contact types (Individual and Household). Presumably it should work, but ought to be tested.