I've migrated this from #1008800: UK phone numbers only display as "+44-", comment 34:
In the 17 Feb dev version (once I'd got rid of #1444442: Fatal error) a regular UK phone number now displays correctly.
But UK mobile numbers don't work at all. As soon as I change the leading number to a 7 (which is the only thing that specifies a mobile number), I get an error:
"70 1234 5678" is not a valid United Kingdom phone number, it should be a 10 digit number like "99 9999 9999", with optional leading "0"
The only way to make it work is to untick the "Enable country level validation" checkbox in the field config.
Comment | File | Size | Author |
---|---|---|---|
#4 | cck_phone-uk_mobile-1450146-4.patch | 560 bytes | samw |
#2 | cck_phone-uk_mobile-1450146-2.patch | 482 bytes | ckng |
Comments
Comment #1
dddbbb CreditAttribution: dddbbb commentedSame problem here.
Comment #2
ckngPlease test out the attached patch.
Comment #3
dddbbb CreditAttribution: dddbbb commentedThe patch in #2 works for me but I just know that my client is going to ask why the leading 0 is automatically removed...
I also tested the results on my Android phone (Dolphin browser) and the phone number was not clickable (as in touch to call number). I guess this is a probably a separate issue though.
Comment #4
samw CreditAttribution: samw commentedPatch worked fine for me, but I also took the liberty of adding 08* non-geographic numbers as well, since I was getting similar errors with those. Does this still work for people?
Comment #5
g1smd CreditAttribution: g1smd commented> "70 1234 5678" is not a valid United Kingdom phone number"
This isn't a mobile number. It's a premium rate Personal Number. It is important to use a "real" number (or at least a "possible" number from a valid range) as an example.
UK mobile numbers begin 074, 075, 07624, 077, 078, 079 (and will likely also use 073, 072, and 071 in the future).
The patch lists 08 numbers as non-geographic. 03 numbers are also non-geographic, as are 0500 numbers.
Some 0800 numbers and all 0500 numbers are a digit shorter than all others with nine NSN digits instead of ten. The patch allows all 08 numbers to be a digit shorter, not just those ranges that actually are a digit shorter.
I have recently generated a complete set of validation and formatting RegEx patterns for every UK number range and number type. It's too long to reproduce here and it would be difficult to maintain multiple copies. This can be seen at:
http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validati...
The first section of the page shows patterns that can be used to identify whether the number is valid and the number type.
The second section shows the various patterns used for formatting each number range.
The code works to the formats listed at:
http://www.aa-asterisk.org.uk/index.php/Number_format
noting the complexities detailed in:
http://www.aa-asterisk.org.uk/index.php/01_numbers
http://www.aa-asterisk.org.uk/index.php/02_numbers
http://www.aa-asterisk.org.uk/index.php/Mixed_areas
and other pages.
Comment #6
g1smd CreditAttribution: g1smd commentedI have rewritten the GB module to cover all UK numbers and will be submitting it as soon as it has been tested.
Comment #7
dddbbb CreditAttribution: dddbbb commentedWhat's the latest regarding this issue?
Comment #8
g1smd CreditAttribution: g1smd commentedRepo owner is still AWOL. I have code ready for 3 months.
Comment #9
goodale CreditAttribution: goodale commentedWould you be able to you post the code anyhow? This still seems to be the most functional phone number module despite the repo owner's absence.
Comment #10
ckng@g1smd, if you have a working fix, please supply the correct patch.
The initial patch has been there for review for so long, since nobody is reviewing it, it is likely other don't need it that much.
I may not have time to work on it currently, but I do still apply reviewed patch.
Comment #11
dddbbb CreditAttribution: dddbbb commented@goodale A new module option popped up earlier this year that seems very promising:
https://drupal.org/project/telephone
Slightly different approach so I guess it depends on your use case but I'm having success with it.
Comment #12
ckngAvailable patches are not working for all cases, if anyone has a better fix, please do so.
Comment #13
jsibley CreditAttribution: jsibley commentedNo progress for the last 8 months? What are people with those phone numbers supposed to do?
Comment #14
togermano CreditAttribution: togermano commentedThanks cck_phone-uk_mobile-1450146-4.patch fixed my websites problem :) you rock!!
Comment #15
Pimmy CreditAttribution: Pimmy commentedPretty standard UK phone numbers like these ones also doesnt work in 7.x-1.0-beta1 (not accepted at all):
0500 41 41 41 (ScrewFix telephone order (landline friendly))
03330 11 21 12 (ScrewFix telephone order (mobile friendly))
Additionally '0345 077 8888' (HomeBase customer service) is throwing 'Notice' messages:
Notice: Undefined offset: 8 in format_gb_phone_number() (line 122 of /home/content/87/10103787/html/sites/all/modules/phone/include/phone.gb.inc).
Comment #16
kscheirerBased on #14