"Invalid state. Try to use the state code." - with no state set.
Dewi Morgan - February 19, 2009 - 13:43
| Project: | e-Commerce |
| Version: | 6.x-4.x-dev |
| Component: | address |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Go to user profile and add an address: user/1/ec_address/add
Use an address for the US or UK (not tried others).
Leave the state field blank, or enter "London", or "TX", or "Texas", or random curses.
eg:
First Name: *
firstname
Last Name: *
lastname
Country: *
United States
State / Province:
Texas
City: *
Austin
Address Line 1: *
address1
Address Line 2:
address2
Zip / Postal Code:
12345
Whatever you put in that field, it will never suggest any options, and will never permit you to submit the form, always displaying:
"Invalid state. Try to use the state code."
Also, the fields in that address form are in the wrong order.

#1
I have the same problem..
#2
I am also experiencing this problem
#3
I can't seem to replicate this, Using TX as the state works fine.
If you could create a test which replicates this then I would be able to fit it.
#4
I had the State/Province problem as well after updating to rc13
GB and USA giving the "Try to use the state code" error.
Here's a quick workaround that doesn't appear to have any side-effects (apart from loss of state validation):
Delete the "Implementation of hook_checkout_validate()" code from ec_customer.checkout.inc to get the Checkout working.
Delete the "Validate an address being saved" code from ec_address.admin.inc to get the manual add working.
Not sure why state validation isn't working for me - perhaps something I haven't got installed/configured?
#5
With the country set to United Kingdom, I have not managed to find any string at all which gets accepted.
An easy way to disable the check on the State field would probably be the most sensible option for UK based e-commerce sites.
#6
No problems after installing the Oct' 13th Snapshot.
Tested a few valid and invalid UK addresses and checkout is working fine.
#7
I can confirm that this bug still exists on a fresh install of 6.x-4-dev.
I have set up the the store for UNITED STATES. The test address used TX and TEXAS for states. Same result with both.Can't complete the payment page with the outstanding error.
#8
I also have this on the rc15 release on a new install.
Store is set to in UK. Only valid country is UK.
But the drop down list of countries on the cart still shows ALL countries (even though the others are not allowed).
Trying to add an address to the user directly (user/1/ec_address/add) doesn't work at all. I get http 500.
#9
I have had this problem on all of the latest releases but Zound's suggestion seems to have worked.
Many thanks