Active
Project:
Addresses
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Aug 2010 at 16:19 UTC
Updated:
28 Aug 2010 at 01:26 UTC
Jump to comment: Most recent file
First, thanks for a great module. Big help to us.
The module stores United Kingdom country as uk, not gb, which is its "official assignment" per http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 (yes, I realize Great Britain is not a country, but a standard is a standard). It also uses lower case for these codes, which perplexes me. The above shows all codes as upper case with no mention of case insensitivity.
This leads to incompatibilities with, for example, Ubercart, which correctly uses 'GB' in its uc_countries table, and which also correctly stores the codes in upper case.
Is there a rational argument for these decisions or shall I be more constructive by contributing a patch?
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | addresses.zip | 234.13 KB | dwightaspinwall |
Comments
Comment #1
AlexisWilke commentedHi dwightaspinwall,
To change something like the country code, we definitively need a patch that will go through all the database tables that uses that code and fix them. I go agree that UK should be fixed to GB. (Note that UK is exceptionally reserved for United Kingdom.)
As for the upper/lower case problem, the function used to get the codes can change the case for you. I would think that's enough. It could be a problem in the database in which case LOWER() or UPPER() must be used.
If you can provide a patch to fix the UK/GB problem then it would be great!
Thank you.
Alexis
Comment #2
dwightaspinwall commentedThe change is pretty trivial:
1) in addresses.inc, change:
'uk' => t('United Kingdom'),
to
'gb' => t('United Kingdom'),
2) rename file uk.inc to gb.inc
Unless I'm missing something, that should do it. Can't roll a patch since new files are involved, but I've attached a zip of the module with the changes (from the latest dev).
There are no "database tables" to change. While this module ought to be storing the country/province info in db tables, it is not. That would require a larger refactoring that I can't take on right now.
Comment #3
AlexisWilke commenteddwightaspinwall,
The following field defines the country with 2 letters (addresses/addresses.module:55):
In the addresses_user.install you have a foreach() that adds such fields to the user table:
The result is that you have a country field in databases that could be set to 'uk' in many databases. Those would need to be changed to 'gb'.
Thank you.
Alexis Wilke