Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#6 | Address Field Form.png | 24.39 KB | coredumperror |
#2 | addressfield-wrong-street-house-nr-order-2564897-1.patch | 824 bytes | Elin Yordanov |
Comments
Comment #2
Elin Yordanov CreditAttribution: Elin Yordanov commentedHere's the patch.
Comment #3
coredumperror CreditAttribution: coredumperror commentedWhoops, sorry about that. I've never used AddressField, so I hadn't noticed.
Thanks for the patch! I'll get it applied immediately.
Comment #5
coredumperror CreditAttribution: coredumperror commentedWait... 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.
Comment #6
coredumperror CreditAttribution: coredumperror commentedOK, 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.
Comment #7
Elin Yordanov CreditAttribution: Elin Yordanov commentedIn 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.