I get this during 5.x-2.0-rc1 and 5.x-1.x-dev...
When creating a new address with any country outside of the US, the zones load but when I select one and submit, it reverts to the US zones and says..
"An illegal choice has been detected. Please contact the site administrator."
This happens during registration, during "add an address" and during checkout (selecting an address).
Any help would be appreciated!
Comments
Comment #1
ckenda1 commentedWanted to add some info..
This doesn't happen if I remove/uninstall uc_addresses. Users then have to enter all their info at checkout, but it works fine. With uc_addresses installed and in use, any non-US country that gets selected, the correct zones populate, but then when you select a zone and submit I get the error above and the Zones revert to US zones even though the Country is still correct.
Again, this happens during registration, during "add an address" and during checkout (selecting an address).
thanks
Comment #2
ckenda1 commentedWatchdog log as promised...
Type form
Date Saturday, September 13, 2008 - 01:11
User admin
Location ..removed..
Referrer ..removed..
Message Illegal choice 1798 in Zone element.
Severity error
Hostname ..removed..
I get different "Illegal choice" messages, but all related to the bug above..
Comment #3
freixas commentedI was able to duplicate.
Comment #4
freixas commentedOk, I think this is now fixed. I started with some code copied from uc_order. The fix was to revise how I check for the country code,
For uc_order, the code is:
This is similar to what I was using. My new code is:
The country value was stored in a difference place in the $POST array. This fix was made in two places in uc_addresses_address_pane.inc.
In the process of testing this, I found and fixed a bug with the new address name feature, so this is a twofer.
I just checked the code into CVS and it should appear in the dev build tomorrow or so.
Thanks for reporting this problem. Please let me know if this resolves your issue.
Comment #5
ckenda1 commentedWhen you say dev build, do you mean 2.0-rcx or 1.x-dev ?
I'll try it out tomorrow and let you know if this fixed it.
Thanks!
Comment #6
ckenda1 commentedDoesn't occur when adding a new address, but the bug is still there during account registration.
Comment #7
freixas commentedFigures. The form is the same for registration as for adding a new address, so I figured I didn't need to check. As it happens, I need the old code for registration and the new code for adding/editing an address (in My Account).
The revised code is now checked in and this time, I tried registering a new account with a Canadian address, adding a Canadian address, editing a US address into Canadian and vice versa, placing an order with a Canadian address (logged in) and placing an order with a Canadian address (logged out).
All of these worked for me as expected.
We still have a few mysteries:
However, if this fixes your problems, we can bow to the programming Gods and get on with other work. Let me know.
Comment #8
ckenda1 commentedNope, registration is still broken. Adding an address and checkout do work though.
Bug sounds somewhat similar to this one...
http://drupal.org/node/285501
Comment #9
freixas commentedWell, that link that was a real trip through the past...
So there was a problem previously and someone debugged it and decided that changing the reference to the $_POST variable would fix it. And now, to fix a similar problem, I changed it back. Lovely.
It's clear that for the country code to work, I need to get the posted country value. It's also clear that the location of this value varies from form to form.
It's all working for me right now as far as I can tell, so we have a couple of options:
Thanks for your help.
Comment #10
freixas commentedFinally fixed (I hope)! Checked into CVS.
Comment #11
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.