"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
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

Mindexperiment - April 24, 2009 - 13:44

I have the same problem..

#2

funkyhat - October 6, 2009 - 16:17
Version:6.x-4.0-beta6» 6.x-4.0-rc13
Priority:normal» critical

I am also experiencing this problem

#3

gordon - October 6, 2009 - 22:53
Status:active» postponed (maintainer needs more info)

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

zounds - October 9, 2009 - 21:32

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

funkyhat - October 9, 2009 - 14:44

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

zounds - October 16, 2009 - 02:56

No problems after installing the Oct' 13th Snapshot.
Tested a few valid and invalid UK addresses and checkout is working fine.

#7

davea - October 18, 2009 - 20:12
Version:6.x-4.0-rc13» 6.x-4.x-dev

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

tchurch - November 25, 2009 - 12:40
Status:postponed (maintainer needs more info)» active

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

Stitchard - December 3, 2009 - 12:14

I have had this problem on all of the latest releases but Zound's suggestion seems to have worked.

Many thanks

 
 

Drupal is a registered trademark of Dries Buytaert.