magento2: "Customer > Address > State/Province" in admin backend does not honour the "State is Required for" setting, is always required
the “State/Province” (attribute region_id) selectbox in “Customers > Customer > {edit} > Addresses” is always marked as “required” when the selected country has states - even when the option “State is Required for” in “Stores > Configuration > General > State Options” is not enabled for this country.
this prevents saving the customer.
Preconditions
- CE 2.1.0
Steps to reproduce
- in “Stores > Configuration > General > Country Options” enable a country that has regions/states, we’ll use “Switzerland” for the rest of the steps.
- in “Stores > Configuration > General > State Options” ensure option “State is Required for” is not enabled for “Switzerland”
- save, clear config cache
- create or edit a customer, add or edit this customers address
- select “Country: Switzerland”
Expected result
- The “State/Province” selectbox is popuplated and not mandatory
Actual result
- The “State/Province” selectbox is popuplated and marked as required
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 17 (9 by maintainers)
I think the test case was not properly followed as it is reproducible in a 2.1.5 installation.
heck, even the latest development code has still the bogus
<item name="required-entry" xsi:type="boolean">true</item>validation on theregion_idfield.@sma09sjb, @EliasKotlyar just validated on fresh installation for 2.1.5 and 2.2-develop, and it test case is not reproducible.