Closed (works as designed)
Project:
Location
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
6 Jun 2008 at 13:08 UTC
Updated:
19 Aug 2011 at 22:03 UTC
I previously implemented the CCK Address International patch shown here: http://drupal.org/node/175444#comment-731876. This allows users to pick from a list of all countries in a CCK address field without any dependencies.
I'm not sure of all your plans for Location 3, but I'd really recommend including the cck_address_countries table from the patch in your INSTALL file. You can just perform a check to see if the table already exists in a user's database, and if so skip the installation of it.
Once the table is in place, the _location_get_iso3166_list() function located in the location.inc file can be greatly simplified:
<?php
// The following is an array of all countrycode => country-name pairs as layed out in
// ISO 3166-1 alpha-2
function _location_get_iso3166_list() {
$iso3166 = array();
$result = db_query('SELECT * FROM {cck_address_countries} ORDER BY printable_name ASC');
while ($results = db_fetch_object($result)) {
$iso3166[strtolower($results->country_code)] = $results->printable_name;
}
return $iso3166;
}
?>
Comments
Comment #1
sgdev commentedI just realized, 5.x-1.x actually has a post date later than 2.7.
Comment #2
yesct commentedMight be related to
#233059: Wrong ISO code for United Kingdom
Comment #3
yesct commentedIf someone is interested in this, please create a patch against the latest version.
I'll try and collect together the ISO code related issues with tags. Tagging.
Comment #4
summit commentedSubscribing, also for D6 :) Greetings, Martijn
Comment #5
ankur commentedNot sure if this still applies. Re-open this issue for 7.x-4.x only if it still applies in D7