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.

CommentFileSizeAuthor
#6 570190-allow-5digit-gb.patch4.37 KBMustangGB
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gpk’s picture

tobedeleted’s picture

Has 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.

thierry_gd’s picture

Status: Active » Fixed

Fix in 6.2.15 version

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

MustangGB’s picture

Version: 6.x-2.9 » 6.x-2.18
Category: feature » bug
Status: Closed (fixed) » Needs work

01905 23819 is still rejected by the latest release

MustangGB’s picture

Something like this?

MustangGB’s picture

Status: Needs work » Needs review

There is a patch so needs review

MustangGB’s picture

Status: Needs review » Reviewed & tested by the community

In an attempt to gain an audience

g1smd’s picture

Some 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.

g1smd’s picture

The 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.

g1smd’s picture

Status: Reviewed & tested by the community » Closed (duplicate)