Hey made a few tweaks to make it more UK specific, hope this is OK? I might be able to pull in a standard list of counties if that would help?

Let me know cheers.

Comments

fonant’s picture

StatusFileSize
new1.87 KB

Here's my take on the patch for UK addresses.

County field is present but optional (Royal Mail don't use it if Postcode is present). So I don't think we need to ask the user to select from a long list of counties: this is unneeded, and also has the problem of whether to use old-fashioned or new county names.

Formatting of address output also improved, with new lines as normal.

cameron tod’s picture

Thanks Fonant, this patch makes a lot more sense for UK addresses. Would love to see it applied in the next release version.

jdelaune’s picture

So what needs to get discussed? The code could certainly be cleaned up a bit. But overall it seems good. Anything else holding it back from a commit?

fonant’s picture

Just to say be careful cleaning up the code: the locality_block has a style sheet attached to it, so it needs to remain in place even if not displayed. Probably would be better to move the style sheet include somewhere else?

Sadly the UK address format is so completely different to other places in the world, it didn't seem possible to fiddle things without doing this complete re-arrangement for the UK. At least the UK-specific stuff is all in one place!

cameron tod’s picture

There's bug in this patch where the postal code is added to the form twice. I have fixed it locally and will re-roll a new patch shortly.

cameron tod’s picture

Status: Active » Needs review
StatusFileSize
new3.04 KB

Attaching patch.

flortjes’s picture

Seems like we've got this issue twice! I've just submitted a patch for issue #939394: Support for UK addresses and then stumbled upon this one.

jdelaune’s picture

StatusFileSize
new2.27 KB

Hopefully this one will pass the patch police :P

I've tried to minimise the amount of changes it does to the structure of the form elements. I've added an extra class so we can tweak the arrangements of elements for country specific needs such as this.

Fingers crossed :)

jdelaune’s picture

StatusFileSize
new2.34 KB

Fixed an issue with output formatting and re-rolled patch.

Shadlington’s picture

Subbing

sammyd56’s picture

Erm...

;)

Shadlington’s picture

Oh!
Well that's good news :D
My apologies for the unnecessary comment!

iaugur’s picture

I have applied patch #9 and that works for me. Changes State* to County (not required)
Looking forward to this being committed.

Firetracker’s picture

Hi,

Any chance this will be rolled into the actual module? Trying to avoid patching on my latest project :-)

Zap

rlmumford’s picture

Status: Needs review » Reviewed & tested by the community

Setting this to reviewed and tested. Worked for me. Hopefully we can get this into the module now.

damien tournoud’s picture

Status: Reviewed & tested by the community » Fixed

Those type of country-specific tweaks are going to be unmaintainable very quickly. I hope we can come up with a better solution.

In the meantime, merged in 7.x-1.x.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

joachim’s picture

Since without this fix UK addresses are pretty much broken, any chance of a new beta release?

fonant’s picture

Yes! A new beta [7.x-1.0-beta3, 2012-May-29] which works sensibly for the UK. Thanks, folks :)