Details
-
Type:
Bug
-
Status: Done/Fixed
-
Priority:
Trivial
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.7.15
-
Fix Version/s: None
-
Component/s: Internationalisation
-
Labels:
-
Versioning Impact:Patch (backwards-compatible bug fixes)
-
Documentation Required?:None
-
Funding Source:Needs Funding
-
Verified?:No
Description
When an address location has an accent in it, it is possible to export the data in those address fields.
How to reproduce:
- On the dmaster demo, go to address location types: http://dmaster.demo.civicrm.org/civicrm/admin/locationType?reset=1
- Rename "Other" as "Other-é"
- Then go to the demo contact record: http://dmaster.demo.civicrm.org/civicrm/contact/view?reset=1&cid=202
- Add a "Other-é" address for this contact (street/state/country).
- Then go to Search -> search "demo", and export that contact.
- In the fields to export, select the fields to export: contact_id, city = other-é location.
The resulting CSV will have an empty "city" field.
If you go back to location types, and change back to "other", or anything else without an accent, it will export OK.
I tried debugging this, but got lost in the SQL. This was a red flag:
"Expédition-address.street_address as Expédition-street_address" (my location type is "Expédition").
In CRM/Export/BAO/Export.php line ~ 327, the locations are fetched with:
$locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
In in those locationTypes, the values are keyed with "[id] => label". I suspect that is a big part of the bug.