If the imported country code is not in the iso format then it is not imported. The problem occurrs because location_standardize_country_code($val) passes $val by reference and will set $val to 'xx' if $val is longer than two characters. With $val set to 'xx' the look-up in the iso3166 list obviously fails. Solution, take a local copy of $val to pass to location_standardize_country_code().
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | location_feeds-877650-3.patch | 639 bytes | john.money |
Comments
Comment #1
elliotttf commentedI would need to investigate this a bit more, but from my early testing I seem to recall that if a country was not in ISO format the location module would not store it to the database.
Have you tried your changes out and confirmed they work? If so can you roll a patch so I can test?
Comment #2
dippers commentedI'm sorry, I have no idea how to roll a patch. I don 't use Drupal under CVS.
The changes do work and allow you to import 'Mongolia' as well as 'MN'.
Comment #3
john.money commentedConfirmed... the else @ line 205 will never fire with $var = 'Country' because location_standardize_country_code(...) sets $val to 'xx' with pass by reference.
Attached is patch which implements a new var to pass to location_standardize_country_code(...). The expected behavior that if a valid country code is not passed in, then attempt to match the country name now works.
Comment #4
elliotttf commentedFixed. Thanks guys for finding and patching this. Will release a new version shortly.