Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
For example this Worcester phone number: 01905 23819 is being rejected, presumably because it doesn't have 11 digits. As discussed in http://en.wikipedia.org/wiki/UK_telephone_numbering_plan, UK numbers are usually 10 or 11 digits long, although this can vary.
Comment | File | Size | Author |
---|---|---|---|
#6 | 570190-allow-5digit-gb.patch | 4.37 KB | MustangGB |
Comments
Comment #1
gpk CreditAttribution: gpk commentedMarked #618414: is not a valid British phone number as duplicate.
Comment #2
tobedeleted CreditAttribution: tobedeleted commentedHas this issue been addressed in later versions of the module? For now (running 6.x-2.9) I'm forced to add a zero to the end of 10 digit UK numbers for them not to be rejected.
Comment #3
thierry_gd CreditAttribution: thierry_gd commentedFix in 6.2.15 version
Comment #5
MustangGB CreditAttribution: MustangGB commented01905 23819 is still rejected by the latest release
Comment #6
MustangGB CreditAttribution: MustangGB commentedSomething like this?
Comment #7
MustangGB CreditAttribution: MustangGB commentedThere is a patch so needs review
Comment #8
MustangGB CreditAttribution: MustangGB commentedIn an attempt to gain an audience
Comment #9
g1smd CreditAttribution: g1smd commentedSome of the number length terminology used in the code comments is incorrect.
Since the leading zero is not dialled from abroad, it should not be counted.
(020) 7788 7788, (0117) 455 4455, (01987) 777888 and (016973) 44555 are "ten digit numbers", specifically 2+8, 3+7, 4+6 and 5+5 format.
On the other hand, (01606) 77888 and (016977) 3344 are "nine digit numbers", specifically 4+5 and 5+4 format.
All of the above examples are valid UK numbers in 2012.
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 for verifying the input looks like a UK telephone number and then extracting the 44 country code if present, the National Significant Number and the optional extension if present.
The second section shows patterns that can be used to identify whether the National Significant Number (by checking the length and initial digits) is valid and the number type (identified by the initial digits).
The third section shows the various patterns used for formatting each number range (arranged by initial digits).
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.
I'm also the UK metadata editor for the Google libphonenumber project over at:
http://code.google.com/p/libphonenumber/
The xml metadata file there has number length, validation and formatting information for every country.
Comment #10
g1smd CreditAttribution: g1smd commentedThe Phone GB module doesn't correct the format when a number is entered with the wrong format.
I have completely rewritten the GB module to fullly comply with all of the UK formatting rules.
See separate issue #1728312: CCK Phone GB - Complete rewrite of code. for this.
Comment #11
g1smd CreditAttribution: g1smd commented