Skip to content

Feature/addressing gb administrative areas - #19488

Open
i-just wants to merge 2 commits into
5.11from
feature/addressing-gb-administrative-areas
Open

Feature/addressing gb administrative areas#19488
i-just wants to merge 2 commits into
5.11from
feature/addressing-gb-administrative-areas

Conversation

@i-just

@i-just i-just commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Description

This PR bumps commerceguys/addressing requirement to ^2.3.0 and drops our dataset for administrative areas for United Kingdom in favour of one that now ships with the library.

  • our mechanism was added in this PR: Feature/address subdivisions event #13361
  • commerceguys/addressing started shipping with GB counties (administrative areas) in v2.3.0: (see Add administrative areas for Great Britain (GB) commerceguys/addressing#111 (comment))
  • this PR drops our version of the GB dataset, but keeps the extra code that allow developers to manipulate the subdivision data
  • with the changes in this PR released, there's no need to use EVENT_DEFINE_USED_FIELDS, EVENT_DEFINE_FIELD_LABEL and EVENT_DEFINE_USED_SUBDIVISION_FIELDS events to add counties for United Kingdom unless you want to change the new default behaviour;
  • keeping them in shouldn't cause problems, but for clarity it's best to remove if not used for anything beyond what addressing library now offers; I've made the code a bit more defensive in case some fields get duplicated by the use of those events
  • custom formatter is no longer necessary for GB in order to show the administrative area (for the record, that mechanism was first added in Allow override of default address formatter #13242)
  • the data in addressing library is keyed by ISO codes, while our version was keying by county name;
    • if we were to just remove the data and do nothing about the different keys, those "historic" options would still show in the dropdown, because of this bit of code:

      cms/src/helpers/Cp.php

      Lines 2708 to 2711 in 6804f92

      // Persist invalid values in the UI
      if ($value && !isset($options[$value])) {
      $options[$value] = $value;
      }
    • other differences between our (old) data and addressing library's (new) data are:
      • City of Bristol -> Bristol, City of
      • City of Edinburgh -> Edinburgh, City of
      • City of London -> London, City of
      • County Durham -> Durham, County
      • The Vale of Glamorgan -> Vale of Glamorgan, The
      • we had "Westmorland and Furness" which is missing from the addressing data; that's because it was created on April 1, 2023 and doesn't have an official ISO code yet (this is mentioned on the issue #111; the other thing we also didn't update)
  • a migration has been created to handle those changes;

Related issues

@i-just
i-just requested a review from brandonkelly August 25, 2026 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant