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.
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.
Comment | File | Size | Author |
---|---|---|---|
#1 | 2239011.patch | 1.65 KB | roderik |
Comments
Comment #1
roderikYes. 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.)