Replies: 2 comments
-
I'll also add another issue which I think is related: during the craft 4 migration of this site it happened that some addresses ended up without country, which made other services fail. The client and I could not figure out what was the problem because "US" was always chosen in the CP when in fact no country was chosen, it was just the default, which on a UX point of view is misleading |
Beta Was this translation helpful? Give feedback.
-
Craft 4.12.6 and 5.4.7 are out with a “fix” for that: now an |
Beta Was this translation helpful? Give feedback.
-
What happened?
Description
I've got a user facing form for saving addresses where they have to select their country, the client wants to force the users to choose one but start with an empty value.
When sending the form without country for validation I'm not getting an error on the country because it takes "US" by default, even though the user has not chosen one. Sending an empty string as countryCode does not replace the country in the address before it's validated.
I also tried to set an empty string to the config
defaultCountryCode
but I then get a 500 :Does this sound like a possible change ?
Steps to reproduce
defaultCountryCode
to an empty stringExpected behavior
I'm getting a validation error "The country field is required"
Craft CMS version
4.12.1
PHP version
8.2
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
Beta Was this translation helpful? Give feedback.
All reactions