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
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | addresses-6.x-1.x-province-validate.patch | 1.46 KB | AlexisWilke |
Comments
Comment #1
brmassa commentedAlexis,
the patch file is missing.
regards
massa
Comment #2
AlexisWilke commentedIndeed! 8-)
Comment #3
AlexisWilke commentedForgot to change the status.
Comment #4
brmassa commentedAlexis,
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
Comment #5
AlexisWilke commentedMassa,
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
Comment #6
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.