Comments

er_d0s’s picture

mstrelan’s picture

Status: Active » Reviewed & tested by the community

Also, not sure if it's an Australian specific thing, but I would say "Address line 1" and "Address line 2" over "Address 1" and "Address 2".

aidanlis’s picture

Yeha, we have a lot of customers typing their address twice, like they think it is a password verification. Can we have placeholder text as well? This is The Iconic's shipping form ... something like this would be nice: http://share.aidanlister.com/Lag9

aidanlis’s picture

Is there a reason this wasn't implemented as a base class with country specific overrides as methods? Seems like it would be much cleaner.

aidanlis’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new1.61 KB

Here's a patch to display AU and NZ addresses properly. I haven't tackled the refactoring into a class.

mstrelan’s picture

Status: Needs review » Needs work

I think this should also include a maxlength attribute for postal code. It's 4 in AU, not sure about NZ.

Also I don't think the placeholder HTML5 attribute is used in D7 modules as the default doctype is not HTML5. And "your address" is not appropriate anyway, as the addressfield is not necessarily for "you", it could be the address of anything.

And finally I would say Suburb/Town rather than Town / Suburb, at least for AU. Trying to find a form on the Australia Post website. Maybe https://digitalmailbox.auspost.com.au/registration.aspx which doesn't even mention Town.

aidanlis’s picture

Ah good point about not having "Your" -- though placeholders work fine in HTML4. I guess we could make it optional, it does seem to provide a better form experience.

4 letters in both AU/NZ should be fine.

Suburb/Town makes sense as 90% of people will be suburban, but we need town for Bendigo, Mildura, etc.

rszrama’s picture

Component: Code » Address formats
aidanlis’s picture

StatusFileSize
new1.9 KB

Re-attaching a patch to work with the latest addressfield.

ergophobe’s picture

Issue summary: View changes

It seems that the proper input form labels would be

Recipient name
Street address/PO Box number
Suburb/RD/lobby name/etc (= "dependent_locality" field?)
Town/City
Postcode

The proper output format would be
Kilbirnie PostShop
62 Bay Road
Kilbirnie
Wellington 6022

Note that the region is not part of a properly-formatted NZ address.

You can also use a "consolidated" format for output [1, page 81]

In addition to the current formats you can now include the suburb, city and postcode on the same address line, using spaces only, not commas to separate the address elements.

That would make the proper consolidated format
Kilbirnie PostShop
62 Bay Road
Kilbirnie Wellington 6022

The thing is, looking through museum websites and various places, few people seem to use the actual official format except the Contact page for NZ Post, they at least follow their own rules.

Still, it seems like Address Field should format according to official postal specs and if someone wants to put commas in here and there where they don't belong and omit this part and that, that would be up to theme to override it in their theme.

Sources.

These are definitive from NZ Post (and BTW, notice the suspiciously familiar file paths!):
1 - http://www.nzpost.co.nz/sites/default/files/uploads/shared/standards-gui...
2 - http://www.nzpost.co.nz/sites/default/files/uploads/shared/standards-gui...
3 - http://www.nzpost.co.nz/sites/default/files/uploads/shared/standards-gui...
4. http://www.nzpost.co.nz/sending-within-nz/how-to-address-mail/different-...
5. http://www.nzpost.co.nz/business/sending-within-nz/over-300-letters-docu...

Other Sources
6. http://bitboost.com/ref/international-address-formats/new-zealand/
7. http://en.wikipedia.org/wiki/Postcodes_in_New_Zealand
8. https://www.tinz.net.nz/addressing-standards.html
9. http://www.addressdoctor.com/en/countries-data/address-formats.html

ergophobe’s picture

A few helpful links on Australian formats
1. http://www.ipaustralia.gov.au/about-us/corporate/address-standards/
2. http://auspost.com.au/parcels-mail/addressing-guidelines.html
3. http://www.nrm.qld.gov.au/factsheets/pdf/land/l111.pdf
4. http://www.staff.uwa.edu.au/facilities/mail/formats
5. http://en.wikipedia.org/wiki/Suburbs_and_localities_(Australia)
6. http://en.wikipedia.org/wiki/Address_(geography)#Australia

According to #2

Typically, the address should be written in three lines:

  • The top line should contain the recipient's name
  • The second to last line should contain the number and name of the street, PO Box or locked bag number (if applicable)
  • The last line should contain the place name or post office of delivery, state or territory abbreviation and postcode. This line should be printed in capitals without punctuation or underlining, with the postcode put last
  • For international mail, the country name should be in capitals on the bottom line

According to #3

In 1996, it was decided that all localities and suburbs should be officially bounded and named...
Suburb is the term reserved for urban communities.
Locality is the term used in the rural context.

It looks like it should be labelled like this on the input form

Recipient Name
Premise
Street/P.O. Box
Suburb/Locality
State/Territory
Postcode

And on output it should be

Joan Doe, curator
Australian Museum
6 College Street
SYDNEY NSW 2010

A couple of questions
1. So properly speaking Address Line 1 should be "premise" and Address Line 2 should be "thoroughfare," but will this break anything? It shouldn't, since those are just labels, but those who are already collecting data using the US format and entering Australian data will have these reversed.

2. Should the default theming automatically convert city and state to uppercase to conform with postal service standard, or leave that to the user to input (and thus output) as they wish?

ergophobe’s picture

Status: Needs work » Needs review
StatusFileSize
new2.78 KB

Based on the above, I'll throw out another option...

  1. patch does NOT mess with address line 1, address line 2
  2. patch DOES use dependent locality for NZ addresses

#2 likely implies that there needs to be some sort of upgrade path, so there needs to be an install hook before this patch or one like it could be committed. I have no idea what people are doing now with NZ addresses, though, so I don't really know what the install hook should look like.

An alternative to using dependent_locality would be to use sub_administrative_area for the Town/City field for NZ and use locality for the Suburb/RD/PO Box/Private Bag field, but that seems incorrect. But then, I've spent a total of two weeks in NZ, so what do I know?

This still "needs work" but setting to "needs review" b/c it needs that too ;-)

rooby’s picture

I agree that it should be like this:

Recipient Name
Premise
Street/P.O. Box
Suburb/Locality
State/Territory
Postcode

Although "Suburb/Locality" is usually "City/Town" on any most forms I've ever filled in.
Sometimes I've seen "Town/Suburb" but rarely or never "Locality".

And premise is often "Unit number" or similar.

The thing that I think is the most important here is the fact that address 1 & address 2 are backwards.
Address 1 on this module is street and address 2 is premise/unit/etc. but the way we fill out addresses here is the opposite of that.

That is the thing most likely to cause problems IMO. I feel like most users can handle the other label differences.

I'm actually quite surprised by (but then again I should know better than to assume things are obvious):

Also, not sure if it's an Australian specific thing, but I would say "Address line 1" and "Address line 2" over "Address 1" and "Address 2".

Yeha, we have a lot of customers typing their address twice, like they think it is a password verification

Another thing I see is:

Can we have placeholder text as well?

I don't think we should do this. I think it is outside the scope of this module.
If drupal core had placeholder support I would say yes but it doesn't.
For that use a module like placeholder, field_placeholder, form_placeholder, etc.

ergophobe’s picture

This should all be handled in Addressfield 2.0, though I'm not sure that will work in D7
https://drupalcommerce.org/blog/16864/commerce-2x-stories-addressing

rooby’s picture

Creating new versions and new features of things is all well and good but fixing bugs in existing code that people are trying to use should probably take priority I would think, at least to some extent.

I hope when 2.x is out it gets bug fixes.

ergophobe’s picture

Rooby... rereading your comment, most of what you mention is addressed (so to speak) in my patch.

As for the label Suburb/Locality, that is as recommended by the Australian Post. Whether people follow that recommendation, I can't say.

bojanz’s picture

Hello, everyone. This issue is now on top of my TODO list.

Looking at the #10 patch, I see it's removing regions for New Zealand, waiting for confirmation of that in #2387967: Remove New Zealand regions.

bojanz’s picture

Status: Needs review » Needs work

New Zealand no longer has regions, and now has a Suburb field by default:
http://cgit.drupalcode.org/addressfield/commit/?id=c3094ec

I'll reroll and commit the patch in the next few days.

ergophobe’s picture

bojanz - just so you know, everything I know about Australia and NZ addresses is in the links I posted above from the official postal services and was the best info I could find at the time.

I do believe that the documents I used are definitive, so I'm pretty sure it's *right* though maybe not *usual* practice (one of the things I've found from polling Australians is that they have a loose understanding of their addressing system and no two of them I talked to agree!).

I just took this on because I had a need - I'm an American who has traveled to Australia and NZ, but that's about it!

What I've got is definitely better than what is in place now though and I think it's right.

rooby’s picture

I would still argue that "Locality" is not something that is used in Australia in relation to the suburb field and when building websites I would probably go out of my way to change the label.

I can't speak for New Zealand but I have lived in Australia for 30 years and I have never seen it on a form or Australian website that I can remember and anyone I've spoken to says they either haven't seen it or have seen it extremely rarely and not recently.

I'm aware that this is only based on my memory and people I've spoken too but I'm happy to be corrected if you can find somewhere formal that states that it is part of the format.

The links in #11 are all either broken links or don't say anything about locality.

Personally I haven't been able to find a document that specifically says what the labels should be (I haven't spent all that much time searching) but anything I have seen says either "Town", "City", "Suburb", "Town/Suburb" or "City/Suburb".

It also seems that just "Town" or "City" alone aren't as prevalent as they used to be.

ergophobe’s picture

It looks like half of the resources I cited just 10 months ago are 404.

I did find this on the AusPost site which does list the level above State/Territory as "Placename/suburb/locality"

http://auspost.com.au/media/documents/australia-post-addressing-standard...

I couldn't care less one way or the other. It's dead easy to change the labels and I'm happy to do so if someone has a solid single answer. Should it be "Town/Suburb"?

BTW, I'm not actually using this as a patch. I broke it out into a module for my use so that I didn't have to worry about patching Addressfield when it updates. Ideally, though, I'd kill that module once there's an integrated solution.

bojanz’s picture

Status: Needs work » Needs review
StatusFileSize
new104.56 KB
new85.35 KB
new31.03 KB
new2.59 KB

I see that there's some uncertainty around the labels, so I consulted the web sites of Australian post and New Zealand post (screenshots attached).

Based on that, I did the following:
- Used "City/Suburb" as the locality label for Austria.
- Left "State" as the administrative area label for Australia, and "Suburb" as the dependent locality label for New Zealand..
If anyone doesn't like it, they can implement the newly added hook_addressfield_address_format_alter().

I'm open to changing the NZ dependent locality label to "Suburb/Rural delivery no." if there's agreement on that.

As for the address lines, I've removed the placeholders because they're inconsistent with the UX of the rest of the module.
I've changed the address 1 label and removed the address 2 label, and I'm open to removing the address 2 line completely.
However, I see in a screenshot above that some sites still keep the two lines.
What do you think?

rooby’s picture

The Australia one looks really good to me.

I like the removal of the address 2 label but I think leaving the two lines is a good idea.
In my experience a lot of clients still want 2 fields and if you're customising it's probably easier to remove a line than add one in.

I also agree that placeholder text should be handled externally as that seems to be the way all Drupal fields work at this stage.

  • bojanz committed 67b0032 on 7.x-1.x
    Issue #1713698 by bojanz, aidanlis, ergophobe, er_d0s: Correct address...
bojanz’s picture

Status: Needs review » Fixed

Thanks for the feedback, rooby.

I've committed the patch. Feel free to continue providing feedback, we can make followup commits.

joshtaylor’s picture

Perfect, Australian addresses look sane!

ergophobe’s picture

Bojanz, that is brilliant. I looked and looked for official documents... never occurred to me to just try to buy something and see what they ask for on the postal service website.

One fewer patch to apply. Thanks Bojanz!

joshtaylor’s picture

StatusFileSize
new5.71 KB

When applying this fix, the address line 2 still shows.

EDIT:

Okay, it was meant to show, disregard.

Status: Fixed » Closed (fixed)

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

capfive’s picture

Hi Guys, sorry to weigh in on this, but the label is still incorrect.

City/Suburb is really confusing. If my address was Surry Hills, this is a suburb, in the city of Sydney, so even thought I live in the city of Sydney, my suburb is Surry Hills, so would it be Surry Hills to put in the field, Sydney? or Sydney/Surry Hills?

Traditionally in Australia, All you need is the Address, Suburb, Postcode and State, this is the correct format for any Australian address as outlined on Australia Post (our biggest postal network in the country)

as seen here http://auspost.com.au/education/letterwriting/students/addressing.html

If we could get this changed to the following:
Address
Suburb
State
Postcode

That would then be the correct format.

Also just as some backup proof, the Australian government also doesn't use City, also they refer to it as a "Suburb/Locality/City/County" they also state that "Generally suburbs/localities are fully spelled out" but we NEVER use the term Locality as a colloquial one, Suburb would be perfect - Source http://www.ipaustralia.gov.au/about-us/doing-business-with-us/address-st... (Australian Government Information Protection Website)

capfive’s picture

Status: Closed (fixed) » Needs work
rooby’s picture

@capfive:

"City/Suburb" and "City" are possible not so common on government forms (something I have not confirmed for myself - I can recall government forms that include city) but they are very common on forms in general so I doubt that someone seeing "City/Suburb" would be unable to continue due to confusion unless they are unfamiliar with common usage of the slash punctuation mark in English.

The problem with "Suburb" alone is that a lot of people don't live in suburbs.
Larger cities have suburbs but small towns do not.
In that case "Suburb" really doesn't make sense and could be considered confusing.

Thinking about it that way "Town/Suburb" is probably a better option although "Town" and "City" have an extremely similar meaning in the context of an address form.

The "Addressing an envelope" page that you link to on the Australia Post website is to help the general public to not write addresses in a ridiculous fashion on their mailings, it is not a formal specification of mailing address format.

If you follow the breadcrumbs back from that page to http://auspost.com.au/education/letterwriting/index.html it is actually not even aimed at the general public but at children learning to correctly address a letter.

I would even go out on a limb and say I think I could write to them and get them to add town or city to that in addition to suburb so as to be more complete.

While the link you provide to the ipaustralia.gov.au website does indeed talk specifically about suburbs/localities it never states that city/county are not to be used.
The fact that it mentions Suburb/Localities/City/County all together indicates they are interchangeable in terms of that line of the address.
Since, as you mention, we practically never use locality, and I would add the same regarding county, that leaves city and suburb as the ones that we do regularly use.

I would vote against making it "Suburb" but would be happy with either "Town/Suburb" or "City/Suburb".

capfive’s picture

Status: Needs work » Closed (fixed)

@rooby good points made, I guess just knowing how to overwrite it then per country is for a different post :) I am happy with the points you made and i agree :) I actually think Town/Suburb, or maybe City or Suburb / Town or Suburb which indicates to the person filling out the form that it is an or option, not a and/or option might help?

Anyhow changing this back to Closed (fixed)

I like being proven wrong as long as the reason is right :P