I entered in the Apt/Suite number field the value Ste 190 and received the following error message:
Illegal value for Address's Apt/Suite Number field. Only letters, numbers, ' and - are valid. No other special characters allowed.
Hmmm last time I checked Ste are letters. :) I took a look at the code in cck_address.module and looks like the same RegExp is being used for street address and apt/suite, so not sure why it would be handled differently? Any suggestions? Thanks in advance for your help.
Comments
Comment #1
rconstantine commentedI think this is a duplicate issue where I forgot to allow spaces in the regex. Oops again. Will be fixed in the next release, but og_forum is ahead of this in line and there are some big features/fixes involved with that. You could modify the regex to allow spaces and then post your code here for others to use.
Comment #2
sgdev commentedSure ... in cck_address.module in the
cck_address_validate_address_fieldsfunction, find the following line (around line 996):if (($item['apt'] != '') && (!preg_match("/^[\.\'\-[:alpha:]0-9\/]+$/", $item['apt']))) {and change it to as follows:
if (($item['apt'] != '') && (!preg_match("/^[\.\'\-[:alpha:]0-9\/\s]+$/", $item['apt']))) {This will allow spaces to be accepted.
Comment #3
Leeteq commentedComment #4
rconstantine commentedThanks for that. That is correct.
Comment #5
NewZeal commentedIssue fixed.