department-of-veterans-affairs / va.gov-cms

Editor-centered management for Veteran-centered content.
https://prod.cms.va.gov
GNU General Public License v2.0
99 stars 69 forks source link

Update Drupal Address Module to support Philippines addresses #19227

Open davidmpickett opened 2 months ago

davidmpickett commented 2 months ago

User Story or Problem Statement

Should an editor try to edit a Manila facility, the Address widget throws an error.

Further analysis shows that this is related to the state, being "PH" (for Philippines, which is not a state). The address from the Lighthouse Facilities API is

"address": {
                    "physical": {
                        "zip": "01302",
                        "city": "Pasay City",
                        "state": "PH",
                        "address1": "1501 Roxas Boulevard"
                    }
                },

Should an admin save the node, the facility will save with the State subfield as blank.

Subsequently, an editor can edit and save the facility, but this leaves the state blank.

Steps for Implementation

The information about a given State (or "Administrative area," as they call it) in the address module comes from a dependency, the addressing PHP library. We can subscribe to the AddressEvents::SUBDIVISIONS event described in the module's documention. With that, we can add whatever subdivisions we want (including "PH"). (edited)

Drupal.org Address Provides functionality for storing, validating and displaying international postal addresses.

Acceptance Criteria

omahane commented 1 month ago

After some more research, it looks like the information about a given State (or "Administrative area," as they call it) in the address module comes from a dependency, the addressing PHP library. However, there's an event to which we can subscribe, the AddressEvents::SUBDIVISIONS event described in the module's documention. With that, we can add whatever subdivisions we want (including "PH"). (edited)

Drupal.org Address Provides functionality for storing, validating and displaying international postal addresses.

Agile6MSkinner commented 1 month ago

@omahane to look at options and flesh out the ticket. Will also apply to the VBA facility in the Philippines.

jilladams commented 1 month ago

It won't block publishing Manila, but it will block future edits -- Did we decide to consider this launch blocking? Or just: asap when we understand / can get to it?

jilladams commented 1 month ago

We don't know if migrations will break this again. Not currently launch blocking, not blocking editor from editing. If we run into this again, Drupal Admins can re-save the node to fix it.

jilladams commented 1 month ago

5 points is assuming an old Drupal hand does the work. If this goes to someone newer, may look more like an 8.