My apologies if this has been reported, or is fixed in development.
I have a CCK address field with the country field optional and limited to a selection of countries not including the US. If the country is omitted the field is formatted according to the US format, NOT the default address format.
Line 656 of addresses.inc in theme_address():
$default_country = variable_get('addresss_country_default', 'us');
This returns 'us', but I am not sure where address_country_default is supposed to be set to dig any deeper.
Workaround: Add US to list of allowed countries and format its address the same as the default.
-Ralph Sleigh
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | addresses_default_format.patch | 2.15 KB | codycraven |
Comments
Comment #1
codycraven commentedRalphSleigh,
Thank you for the bug report, I will review and address the issue as soon as I can get to it.
Comment #2
intuited commentedHi,
I noticed another typo in the same function:
At line 667 of addresses.inc:
variable_set('addresses_format_'. $default_country, $addres_format);
I don't know what the net effect of this is — I just noticed when checking out the function for other reasons — so I didn't file another bug report.
It would be great to get a bugfix release of this module soon, there are a few quick fixes to be put through. Thanks for maintaining it!
Comment #3
codycraven commentedRalphSleigh,
I see the issue within the logic pertaining to the code you cited. The problem is that 'addresses_country_default' is never set anywhere within the application. Fortunately for us there is a format variable set as 'addresses_format_default'. Thus the solution is to replace all of this logic with a much simpler code - attached as patch.
Please apply this patch and let me know if it works so that I can commit it.
intuitied,
Due to the solution for RalphSleigh there is no need to fix the typo, since it no longer exists - great catch though! I am looking to make a 1.07 release soon, if you find any other bugs please open new issues for each found.
Comment #4
RalphSleigh commentedCodycraven
Your patch works for me (applied to 6.x - 1.06)
-Ralph
Comment #5
codycraven commented