- Issue created by @Spanners
- 🇫🇷France lazzyvn paris
Some country have format Street number street name.
You can debug in modules/contrib/address_suggestion/src/Plugin/AddressProvider/MapboxGeocoding.php$countryFormatSpecial = ['FR', 'CA', 'IE', 'IN', 'IL', 'HK', 'MY', 'OM', 'NZ', 'PH', 'SA', 'SE', 'SG', 'LK', 'TH', 'UK', 'US', 'VN', ];
I think your site config with another country in list not AU
- 🇦🇺Australia Spanners Sydney
I tried updating the array with `AU` but it didn't help.
$countryFormatSpecial = ['AU', 'FR', 'CA', 'IE', 'IN', 'IL', 'HK', 'MY', 'OM', 'NZ', 'PH', 'SA', 'SE', 'SG', 'LK', 'TH', 'UK', 'US', 'VN', ];
I actually updated it for all the providers, in case there was an inheritance, but no good either.
I also tried changing the output by adding text at the start of both options in the if else.
foreach ($content["features"] as $key => $feature) { $results[$key]['street_name'] = $feature["text"]; if (!empty($feature["address"])) { if (!empty($country) && in_array($country, $countryFormatSpecial)) { $results[$key]['street_name'] = 'Thisisedited' . $feature["address"] . ' ' . $results[$key]['street_name']; } else { $results[$key]['street_name'] .= 'Thisisedited' . isset($feature["address"]) ? ', ' . $feature["address"] : ''; } }
But after clearing cache and running cron, resaving the node, trying creating a new node, there was no change to the output.
Double checked that Australia was set in Regional settings and also changed to France, but no change.
Any other ideas?
- 🇫🇷France lazzyvn paris
I think it supports number street format with address field not text field, because in address field we can select country and text field has no hope. Can't interface template, but you can write your own plugin widget
example/** * @AddressProvider( * id = "mapbox_geocoding_au", * label = @Translation("Mapbox Geocoding"), * api = "https://api.mapbox.com/geocoding/v5/mapbox.places/", * ) class MapboxGeocodingAU extends MapboxGeocoding{ public function processQuery($string, $settings) { // call parent processQuery and rewrite $result label with your format } }