If you use an addressfield for location, the generated address has the wrong order of house nummer and street, beside that there's a comma between them.

For instance, given the following address:

John Doe
Sample Street 100
12345 Mycity

the generated location looks like:

LOCATION:John Doe\, 100\, Sample Street\, 12345\, Mycity

expected format would be:
LOCATION:John Doe\, Sample Street 100\, 12345\, Mycity

I've created a small patch for that, please review.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pc-wurm created an issue. See original summary.

Elin Yordanov’s picture

Status: Active » Needs review
FileSize
824 bytes

Here's the patch.

coredumperror’s picture

Whoops, sorry about that. I've never used AddressField, so I hadn't noticed.

Thanks for the patch! I'll get it applied immediately.

  • coredumperror committed 63c03a4 on 7.x-3.x
    Issue #2564897: Fixed street number rendering of AddressFields. Patch by...
coredumperror’s picture

Wait... I'm really tired right now, and I didn't notice this until now. Why would you want the street number to go after the street name? I've only ever seen it go before the name.

coredumperror’s picture

Status: Needs review » Closed (works as designed)
FileSize
24.39 KB

OK, so I installed Address Field to research this further. The issue here is that the $location_field['premise'] value comes from the "Address 2" field in the form, and that's not where the street number is supposed to go. The street number and name are supposed to go in the "Address 1" field. "Address 2" is for things like apartment number, or mail code.

Maybe that field on the form is translated as something else in your version of Drupal? I've attached a screenshot of the English version, to show what I'm talking about.

Elin Yordanov’s picture

In Germany, and most countries in Europe (but France), the house number comes after the street name. It is also very common that it has own field in forms.

I see that it is not very easy to solve this problem, since every country has it's own address formats, which Addressfield module aims to solve using xNAL standards.

For now, I'll try to adjust the LOCATION output extending the views plugin and making those changes, so that the module code is not hacked.

Thanks for the feedback anyway.