Dear guys,

i got the problem with the following australian number: +61 8 82xx xxxx
When i save the content this number gets changed to +61 82xx xxxx

Can anyone tell me why the one-digit area code gets deleted?

Thanks in advance,
F.

CommentFileSizeAuthor
#1 2239011.patch1.65 KBroderik
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

roderik’s picture

FileSize
1.65 KB

Yes. format_int_phone_number() blindly assumes '7' and '8' are national dialing prefixes.

You can either apply #2186331-3: phone_field_presave() calls format_phone_number(), breaking input data integrity and then #1563692-6: format_int_phone_number() fails to use the appropriate country formatter and strips bits out of valid Swedish phone numbers...

...or you can apply the patch attached here. It is basically a version of #1563692 that does not need #2186331 applied first. I made it before discovering I didn't really need it.

(I am not going to put it up for 'needs review' because I'd rather have #2186331-3 discussed and then #1563692-6 applied after that... but I'm not sure if #2186331-3 is quite ready yet.)