Canadian provinces not updated

Created on 24 October 2023, about 1 year ago
Updated 19 November 2023, about 1 year ago

Problem/Motivation

First thing first: many thanks for address suggestion. I am using Drupal for Geographical data for the first time and Address Suggestion has been super helpful. Having just one module to get a correct address + a geocode in one API call is fantastic.

Using it in Québec however, the Drupal address "province" field is not updated on address autocompletion.

Steps to reproduce

In an address (suggestion) field, chose Canada as a country so you get the list of provinces.

Upon selecting an address suggestion, all the other fields (except province) are filled with the correct data.

Proposed resolution

in js / address_suggestion.js

Replace: form_wrapper.find('select.administrative-area').val(ui.item.state);

By: form_wrapper.find('select.administrative-area').val(ui.item.administrative_area);

Remaining tasks

It works for me (and for anyone in Canada, I guess) but it may break in other countries(?).

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇨🇦Canada jcornuz@gmail.com

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024