Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 3.1.1
-
Fix Version/s: 3.1.2
-
Component/s: Core CiviCRM
-
Labels:None
Description
When importing contacts using a saved mapping profile, once a field is mapped as a relationship it is impossible to switch it back to a normal field.
Steps to reproduce on sandbox
1 Import a csv as individual contact type
2 Make one of the fields a "Employee of" and "organization name"
3 Click 'save this field mapping' and give it a name
4 Click Continue
then...
1. Go back and import a csv again, loading the same field mapping
2. Change the "Employee of" field to map to a normal field like "city" or something
3. Click 'update this field mapping'
4. Click Continue
CiviCRM should have modified the field mapping but it hasn't. To verify, try another import loading the field mapping and the relationship mapping will still be there (hopefully!)
To fix it...
civicrm\CRM\Import\Form\MapField.php, line 837, change:
$updateMappingFields->relationship_type_id = null;
...to...
$updateMappingFields->relationship_type_id = 'NULL';
$updateMappingFields->relationship_direction = 'NULL';
line