Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.6.17, 4.7.15, 4.7.16, 4.7.23
-
Fix Version/s: 4.7.30
-
Component/s: Core CiviCRM, Import
-
Labels:
-
Versioning Impact:Patch (backwards-compatible bug fixes)
-
Documentation Required?:None
-
Funding Source:Contributed Code
-
Verified?:No
Description
When CiviCRM is configured with multiple countries enabled, the state field may be set incorrectly when contacts are imported. This occurs when
- Multiple countries are set as "Available" on Administer-Settings-Localization
- The state abbreviation is ambiguous among the enabled countries
- The country field is not specified or is blank in the record(s) being imported.
Thus, if "United States," "Guyana," and "Netherlands" are made available, and the state field contains the abbreviation "UT" a record with the country specified as "United States" will correctly be assigned the state "Utah." If no country is specified, the State/Province field will be set to "Upper Takutu-Upper Essequibo" in Guyana. If only one country is enabled, the State/Province field is correctly set.
This behavior has been confirmed in the current CiviCRM public demo/sandbox (as of 17/Jan/16 17), which shows as version 4.7.16.
If no country is specified, the configured default country should be used to identify the correct state abbreviation.
To reproduce
- Go to Administer-Localization-Languages, Currency, Locations
- Set "Default Country" to "United States"
- Add United States, Guyana and Netherlands to the Available Countries
- Add United States, Guyana and Netherlands to the Available States and Provinces
- Save the configuration
- Import the attached file civicrm_import_bug_test.csv, mapping columns F-K to Street Address, Supplemental Address 1, City, State/Province, Postal Code and Country for the location "Home"
- Map columns L-Q to Street Address, Supplemental Address 1, City, State/Province, Postal Code and Country for the location "Other"
- Complete the import
- Examine the imported contact record for John Doe
- Address in Home location will show as being in Upper Takutu-Upper Essequibo, Guyana
- Address in Other location will show as being in Utah, United States
The workaround for this issue is to ensure that, when importing address data, that a valid country is always specified when there is data in a State/Province field.