Problem/Motivation

When using Google Maps provider address fields not getting properly populated.
For instance full state name used as a city name.

Steps to reproduce

Use Google Maps provider, try type some US address.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

minnur created an issue. See original summary.

minnur’s picture

StatusFileSize
new1.44 KB
minnur’s picture

Also for US addresses the street number should be in front of the street name. e.g. 11 Main Street.

superlolo95’s picture

If the street number is empty, the street name should not be preceeded by a blank character.

$results[$key]["street_name"] = (!empty($streetNumber) ? $streetNumber : "") . " " . $street_name;
should be more
$results[$key]["street_name"] = (!empty($streetNumber) ? $streetNumber . " " : "") . $street_name;

dejan0’s picture

Thanks, @minnur and @superlolo95, I will test it!

lazzyvn’s picture

Some country have format address like this [Street number] [street name]
not [Street name], [Street number]
so we must have code country to detect
here is list
$country_format_special = ['FR','CA','IE','IN','IL','HK','MY','OM','NZ','PH','SA','SE','SG','LK','TH','UK','US','VN'];

i think there is some country have to swap state vs city name the list can be found in module address

for more information https://fr.wikipedia.org/wiki/Adresse_postale

minnur’s picture

@lazzyvn that makes sense, probably it would be best to create a separate plugin for US addresses. Or maybe refine logic and present addresses based on its address

rhovland’s picture

There's no need to change the name of the town name key so I removed that from the patch

socialnicheguru’s picture

Status: Active » Needs review
socialnicheguru’s picture

Status: Needs review » Needs work

the widget does not fill in the state when I select the US.

This patch fixes states not being selected or filled in: Administrative area is not handled

lazzyvn’s picture

you can use my module address suggestion more feature and config provider in widget

criz’s picture

@lazzyvn Why did you fork this module? Does not make any sense. :( We don't have always time to test/commit merge requests immediately, but this module is definitely not abandoned. We can also add you as maintainer if you are interested.

lazzyvn’s picture

Because my logic is not the same. I want the config provider in the widget not in the module config

criz’s picture

@lazzyvn Then I would suggest to create an issue about this (add configuration for provider also in the widget). I don't think its good to have two modules, just with different places where configuration is done. And tell us if you want to be added as maintainer.

lazzyvn’s picture

Oh I made a lot of merge requests but over a year ago no one approved them. There are a lot of bugs and the community made a lot of patch but no one listens feedback to fix or add to dev. So i think it's so hard to request a new feature.
This module is still in beta, so I can't add module with composer to drupal 9,this is a reason why i decided to create a new module i change 80% of the code i just keep 2 file providers(Swiss Post and Google Maps)

socialnicheguru’s picture

klonos’s picture

#3226560: Commas in an address breaks autocomplete and #3260954: Administrative area is not handled were recently committed to the latest dev version (along with some other commits), so the patch in #8 doesn't apply any longer.

klonos’s picture

...testing the latest dev version, I confirm that things work properly now:

  • The "State" select/dropdown is populated properly (tested with Aussie addresses) 👍
  • The street number is retained to the front of the address (tested with Greek and Aussie addresses) 👍

What I have noticed is that:

  • A blank/space character is still being inserted at the start of the address field if the address has no number 👎 (tested with things like "Melbourne Airport" or " Sydney Harbour Bridge")
  • "Sydney Harbour Bridge" works as expected 👍, but "Melbourne Airport" does not 👎 (the address field is left completely blank after selecting the returned result)

Anyway, my point is that people should test the latest dev version, and then confirm if the originally-reported issue here still applies. If not, then I believe that we should close this issue here, and open separate, new issues for each problem - keeping all problems in a single issue does not help.

rhovland’s picture

Status: Needs work » Closed (outdated)

The google maps provider was rewritten and I'm not seeing any of these problems with it. Closing as outdated. Please reopen if you can reproduce any of these issues in the latest release.