You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This relates to craftcms/cms#13101, but is a bit different. I actually don't really care if our address form shows or doesn't show UK counties. However, I notice that when we call:
When we go to the Craft CP, navigate to a user with a United Kingdom address, and edit it, no administrative areas are available to be selected. Also, whatever the user originally entered into our form for their administrative area wasn't saved.
The output of getAdministrativeAreasListByCountryCode should match the list of administrative areas used by the Craft CP.
I'd love to know how to get these to match. I'm fine getting our form to match what the CP is doing. I don't have a horse in the race of counties vs. no counties in the UK. I'd also prefer to do this without resorting to custom code that is GB-specific, since I presume the issue is a specific case of a more general one and we could run into the same with other countries.
Expected behavior
Both the Craft CP and the getAdministrativeAreasListByCountryCode method should both use the same list (even an empty list) of administrative areas for GB.
Actual behavior
The Craft CP provides no administrative areas for GB. The method getAdministrativeAreasListByCountryCode returns 213 administrative areas for GB.
Craft CMS version
4.5.10 Pro
Craft Commerce version
4.3.2
PHP version
8.0.30
Operating system and version
Linux 5.3.0-7648-generic
Database type and version
MariaDB 10.4.32
Image driver and version
Imagick 3.7.0 (ImageMagick 6.9.11-60)
Installed plugins and versions
Amazon S3 2.0.3
Asset Rev 7.0.0
Craft Commerce 4_3_2
Inventory 3.1.1
Redactor 3.0.4
Redirect Manager 2.0.0
Sentry SDK 2.0.1
Stripe for Craft Commerce 4.0.1.1
Super Table 3.0.12
Typed link field 2.1.5
The text was updated successfully, but these errors were encountered:
If the above is not added, the subdivision field won't show for the GB in the control panel, and the value won't be saved in the database when added via the front-end. The list of subdivisions is still there if the field is not added via the event (hence it's returned via craft.commerce.store.getStore().getAdministrativeAreasListByCountryCode()), but not used.
So, theoretically, there should be no need to getAdministrativeAreasListByCountryCode() if you're not adding the the ADMINISTRATIVE_AREA field via event.
What happened?
Description
This relates to craftcms/cms#13101, but is a bit different. I actually don't really care if our address form shows or doesn't show UK counties. However, I notice that when we call:
It returns a list of administrative areas for GB.
When we go to the Craft CP, navigate to a user with a United Kingdom address, and edit it, no administrative areas are available to be selected. Also, whatever the user originally entered into our form for their administrative area wasn't saved.
The output of
getAdministrativeAreasListByCountryCode
should match the list of administrative areas used by the Craft CP.I'd love to know how to get these to match. I'm fine getting our form to match what the CP is doing. I don't have a horse in the race of counties vs. no counties in the UK. I'd also prefer to do this without resorting to custom code that is GB-specific, since I presume the issue is a specific case of a more general one and we could run into the same with other countries.
Expected behavior
Both the Craft CP and the
getAdministrativeAreasListByCountryCode
method should both use the same list (even an empty list) of administrative areas for GB.Actual behavior
The Craft CP provides no administrative areas for GB. The method
getAdministrativeAreasListByCountryCode
returns 213 administrative areas for GB.Craft CMS version
4.5.10 Pro
Craft Commerce version
4.3.2
PHP version
8.0.30
Operating system and version
Linux 5.3.0-7648-generic
Database type and version
MariaDB 10.4.32
Image driver and version
Imagick 3.7.0 (ImageMagick 6.9.11-60)
Installed plugins and versions
The text was updated successfully, but these errors were encountered: