I am adding a product. Under Default product pickup address. I set my country to Canada. It changes the State/Province drop-down menu to have Canadian provinces. I choose Saskatchewan. I select Save.

I get a red bar at the top of the screen that says: "An illegal choice has been detected. Please contact the site administrator." The State/Province drop-down menu is outlined in red, and only US States are showing up now even though the Country still says Canada.

If I try to change the country to United States and then back to Canada again, the State/Province drop-down menu no longer changes.

Setting a Default Product Pickup Address in the US works fine.

Comments

rszrama’s picture

Assigned: Unassigned » Island Usurper
Priority: Critical » Normal
Island Usurper’s picture

Status: Active » Needs work
StatusFileSize
new3.5 KB

OK, I think the thing to do is to use the AHAH framework like it's supposed to be used, so here's a patch that makes it happen on the product edit form. This breaks the old functionality on every other address form, so it's not completely ready yet.

I'd like to be able to make attaching the AHAH behavior generic enough so that it can be put on all of the other forms with minimal fuss. Ideas welcome.

cha0s’s picture

This patch doesn't apply anymore, can we get a reroll?

cha0s’s picture

Status: Needs work » Postponed (maintainer needs more info)
StatusFileSize
new3.21 KB

So... I've been struggling to make this work correctly, but it's a quagmire.

1) Massive callback duplication

2) Using a module like http://drupal.org/project/ahah_helper

Now sure, *technically* we could roll our own generic AHAH attachment stuff. The question though, is it worth the effort? I tried, and it is not trivial. The forms are simply not unified enough.

However, I have to personally recommend the ahah_helper module. It's also used on mollom.org, so this isn't some POS we're talking about :). However, I did find a bug, which I've reported at #415560: ['#ahah_helper']['#file'] is non-existent!. Besides that, it's a very clean, sane way of doing AHAH, and if we're serious about this, we should consider leveraging it.

P.S. I attached a patch of what code using it would look like.

cha0s’s picture

Status: Postponed (maintainer needs more info) » Postponed

After chatting with Ryan, we're going to postpone this until the next version of Ubercart, as it will represent a bunch of changes, not to mention another dependency. ;)

Native AHAH in Drupal 6 is pretty painful, unfortunately.

Island Usurper’s picture

Title: Cannot create products with Canadian addresses » Cannot create products with addresses in countries other than the site's default

Because it's not really Canada's fault. ;)

tr’s picture

Version: 6.x-2.0-beta2 » 7.x-3.x-dev
Category: bug » feature
Status: Postponed » Active

Let's see if this can be addressed in the D7 branch.

ludp’s picture

Version: 7.x-3.x-dev » 7.x-3.0-beta2

Still the same behavior: showing the correct states/provinces for the country selection, but upon "Review Order": Illegal choice has been detected and now only US states can be selected.

tr’s picture

Version: 7.x-3.0-beta2 » 7.x-3.x-dev

Yes, I'm aware of that - that's why I reopened the issue ...

particlegirl’s picture

subscribe

particlegirl’s picture

Just letting you know i am getting this problem on a fresh install of d7 and uc 3, everything else is working so well. I really need to have all countries as an option. I'm only getting this problem on 'review order'. All the states are present for entering in the information, its only after i've click 'review order' that it all falls apart. Thank you so much for any assistance here..

longwave’s picture

Status: Active » Closed (duplicate)
particlegirl’s picture

thank you very much, sorry I had actually missed that.