Closed (fixed)
Project:
Address field for CCK
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Apr 2007 at 17:14 UTC
Updated:
24 May 2007 at 00:02 UTC
Validation of Street and Street Continued fields in Canadian Address is too restrictive. Canadian street address can have a suffix after the building number like "123A Main St" or "123 1/2 Main St", but current validation function does not allow any characters other than letters and digits.
Validation of Canadian Address should allow entry of "/" character in "Street" and "Street Continued" fields.
Comments
Comment #1
rconstantine commentedokay. I can add that to the validation. are there any other characters? i think i'll add country-specific validation routines to the country's module, then call it from the main module. i'll get to this next Wednesday (my designated module maintenance day).
thanks for the heads-up.
Comment #2
sshvetsov commentedI think it's a good idea to make validation country specific. There are no other characters that I can think of at the moment. Perhaps some special characters in the street name itself, like "-". There's also a matter of French letters like "È", will those be allowed?
Comment #3
rconstantine commentedI think i have a work-around for language-specific validation. Using the setLocale function, when validation begins for a specific country, I can store the current locale; switch to one that the country's language needs; validate; if invalid, try another locale defined for that country; validate; if invalid... repeat for each language official to that country until valid, or no locales worked; if no locales worked, there should be a real error in the input; after validation completes, reset the locale to the saved value. I'll implement this as a hook, so that I'll be able to check for the existence of the country-specific validation function and handle missing ones gracefully. However, it will be on the country plugin developer to validate correctly. Fortunately for you, I'm handling Canada. I probably won't add other countries myself, but will respond to suggestions in extending support for the creation of support for other countries.
On my next module update day, I do need to address some issues with my cck_fullname module and my accounttypes module, so cck_address may have to be put off for one week if I don't get the others fixed quickly enough.
Thanks for your patience.
Comment #4
rconstantine commentedI just finished designing the new hook. It seems to work with U.S. addresses. I'll do the Canadian next, then upload.
Comment #5
rconstantine commentedLook for a new dev release today.
Comment #6
(not verified) commented