Closed (fixed)
Project:
Phone
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Reporter:
Created:
6 Aug 2012 at 15:17 UTC
Updated:
26 Dec 2012 at 20:00 UTC
Jump to comment: Most recent file
This is the error message I get when inputting unacceptable data into the phone number field, such as, letters or too many numbers. It would be helpful if the errors were human friendly.
I am using the US and Canada restriction. It works great if valid input is submitted.
Thank you!
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | phone-fix_message_error-1715380-15.patch | 595 bytes | -enzo- |
| #10 | phone-1715380-10.patch | 595 bytes | star-szr |
| #8 | noticeline381-1715380-8.patch | 744 bytes | rfsbsb |
| #6 | noticeline381-1715380-6.patch | 744 bytes | rfsbsb |
| #2 | noticeline381-1715380-2.patch | 698 bytes | rfsbsb |
Comments
Comment #1
jessico commentedAny ideas on how to modify the module to create our own error messages?
Comment #2
rfsbsbHere's a patch to solve this.
Comment #3
rfsbsbPlease review this patch.
Comment #4
seworthi commentedPer the "hook_field_validate" API (http://api.drupal.org/api/drupal/modules!field!field.api.php/function/ho...), this is what we should change line 156 to:
And we should add this:
This is what I did and it solved the issue.
Comment #5
jessico commentedI'm getting an error when I try to apply the patch:
[root@webdev phone]# pwd
/var/www/drupal/sites/all/modules/phone
[root@webdev phone]# patch < phone_error.patch
patching file phone.module
patch: **** malformed patch at line 17:
I have tried the -p1 and -p0 parameters, as well as 'git apply path/file.patch'
I'm trying to evaluate the patch to see what the issue is, but am still fairly new at code analysis. Maybe I am applying the patch incorrectly, but this has seemed to work in the past for other patches. Any ideas?
I sincerely appreciate your time and assistance!
Comment #6
rfsbsbAs suggested by seworthi, I changed the patch to fit correctly to the API.
Comment #7
rfsbsbHi acissej, first you must checkout the latest version from repo (instructions here http://drupal.org/node/87303/git-instructions/7.x-1.x). Then you should download the patch and apply using the instruction in the link above in the section "applying a patch"
Hope it helps.
Comment #8
rfsbsbIn fact this is the correct patch. Sorry.
Comment #9
jessico commentedThe #8 patched worked great! I am very thankful for your help!
Just to offer clarification for anyone else who runs across this thread. I used the instructions linked in comment #7 to pull down the latest project code and apply the patch.
Much gratitude!
Comment #10
star-szrRerolled patch - no longer removes the extra newline at the end of the file and applies cleanly to 7.x-1.x-dev with or without git.
Comment #11
5n00py commentedThis patch fix the error, but validation only show error message and pass the wrong value....
Comment #12
mgiffordLooks good. I just applied this to the git repo and tested it.
It's much better, but I got it because I wanted to put in an area code only into the default content.
It would be nice if the (613) were already there so folks just had to type in the 555-1212 after it.
Comment #13
carajito commentedErrors:
Comment #14
mgiffordWell, that's not good. What were you doing?
Can you give us some details so we can repeat it? This is for international phone numbers?
Comment #15
-enzo- commentedRerolled patch #10 against branch 7.x.1.x
Comment #16
baronmunchowsen commented#15 Works well for me.
Comment #17
flatfeat commented#15 works great for me, too.
Comment #18
warmth commentedIs this patch going to be committed at least to the dev version? It's urgent!
Comment #19
5n00py commentedYou shouldn't use any variables when calling t() function. Only string literals with placeholders.
See http://api.drupal.org/api/drupal/includes!bootstrap.inc/function/t/7
Comment #20
cmejo commentedHello. I am getting the same error as the OP when a user tries to register for my site including a South African phone #. I am validating against US & Canada though we have international users signup on our site and I didn't think they wouldn't be allowed to enter a non-US & Canada phone #. The phone # was written like this: 27215555555 (obviously different digits than the 5's).
According to the phone.info file, the version of phone-7.x-1.x-dev is from 2012-03-02.
I perused the README file and it does not confirm support for South African phone numbers though I notice in the phone.module file there is a line for South Africa.
This was brought to my attention by a user that emailed me through the contact form on our site. He gave me screenshots of his signup process and I went through each field to find the problem. I am very confident the problem lines with this module.
What do I need to do to solve this issue? Should I update to a newer dev version or apply one of these patches? Thank you.
Comment #21
cweagansTechnically, I shouldn't be okay with having a variable inside t() like that, but since we're already doing it and we're getting rid of a notice, I can accept this for now. Over to rfsbsb for final review and commit.
Comment #22
lotyrin commentedThe patch doesn't apply.
Comment #23
lotyrin commentedBecause it's been applied!
Comment #24
rfsbsbIndeed this patch has already been applied http://drupalcode.org/project/phone.git/commit/ab36332
Comment #25
cweagansSorry about that!
Comment #26
cmejo commentedThanks all! I spoke with cweagans on IRC and he applied the patch. I should have updated this thread.