I had a problem with the Province validation code before and sent you a first fix (i.e. when the country is not defined, the province could not be defined.)

Now, I add two more things:

1. The province can be defined with its abbreviation or in full (i.e. CA or California). The case does not matter.

2. The error, in case the province cannot be found or was misspelled, now says "province BLAH not found in FOO provinces". It think that such an error will be a lot more helpful.

Thank you.
Alexis

Comments

brmassa’s picture

Status: Needs review » Needs work

Alexis,

the patch file is missing.

regards

massa

AlexisWilke’s picture

StatusFileSize
new1.46 KB

Indeed! 8-)

AlexisWilke’s picture

Status: Needs work » Needs review

Forgot to change the status.

brmassa’s picture

Status: Needs review » Fixed

Alexis,

i commited the patch with some modifications. The most relevant one is that the state/province still needs the province CODE and not the name. Its because, in case the user enters the province name, we still need to convert it to province code before saving it on DB. Also, it will be quite unnecessary if we manager to implement a JS that loads a dropdown box with all states (a long waited feature)

regards,

massa

AlexisWilke’s picture

Massa,

One thing, maybe, would be to make sure that for the provinces 1 to 9 (for France) can be entered with or without the zero (i.e. 1 and 01 should both work.)

Now an AJAX script would be neat. Many sites now a day does that. But it would force us to ask for the country first.

Now, I do not disagree with you in regard to saving only the abbreviation. And you can do that by converting the province name to its abbreviation. However, preventing a user from typing Doubs instead of 25 sounds harsh. In France, we're used to type the name, not the code.

What I suggest is that we fix _addresses_user_address_save() and keep the array_uintersection() here.

Thank you
Alexis

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.