Hi ,I added the Austrian phone number to the module (local here).
How can I send you a patch?
I added the phone.at.inc as file attachment, you also have to update the countries.txt (add line "at => Austria"), and the phone.module (add line "'at' => 'Austria',").

it is a very basic regex, but should work.
Cheers, Christian

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

steinmb’s picture

Pls. make a patch by following http://drupal.org/node/707484. It is the quickest way of getting your stuff into a drupal module but also best practice.

mgifford’s picture

Isn't this supposed to be against this file here - http://drupalcode.org/project/phone.git/blob/refs/heads/7.x-1.x:/include...

Not sure what phone.at.inc is other than perhaps a typo.

steinmb’s picture

Wrong country :) (Bush jr. also did this) Let's roll this (untested).

steinmb’s picture

Assigned: nerdoc » Unassigned
fago’s picture

Status: Needs review » Needs work

patch file is empty.

fago’s picture

Status: Needs work » Needs review
FileSize
2.61 KB

took the include, cleaned some code style only and rolled a proper patch. Also sorts countries so it's easier to find.

fago’s picture

>Not sure what phone.at.inc is other than perhaps a typo.

lol. Yeah, austria != australia!

fago’s picture

FileSize
2.66 KB

Turned out the swiss regex break some Austrian numbers. Attached patch fixes that for me and cares for formatting prefixes with different lengths accordingly (4 digit mobile numbers, vs 5 digits others).

steinmb’s picture

Ooobs, posted the wrong patch in #3, I'm such a moron :)

fago’s picture

#8 works well for me. Any reviews or other testers?

rfsbsb’s picture

The valid_at_phone_number function has a comment pointing to a Wikipedia page referenced to Switzerland phone number and not to Austria. It sounded a little bit awkward to me. Does the two countries use the same system? Maybe this document https://www.rtr.at/en/tk/E129 can help clarify.

Anyway, the patch apply and the validation works. If someone confirms it's okay for Austrian validation and format, we can commit the patch.

BarwonHack’s picture

Not sure if related, but currently cannot add a mobile phone number EG: 0400 123 456, only land line numbers EG: (03) 9123 4567.

Update: 0499 123 456 is rejected but 0409 123 456 is accepted. 0499 xxx xxx is a valid australian mobile number.

BarwonHack’s picture

Priority: Normal » Major
rfsbsb’s picture

Priority: Major » Normal

Hi @smilne23 can you add more details to my question in comment number 11? I guess the patch would fix your problem, but I must confirm these questions before commit the patch.

BarwonHack’s picture

Hmmm, my bad ... misread Austrian as Australian. I'm down under. I'll create a new issue.

nerdoc’s picture

FileSize
2.63 KB

I corrected the link to the Austrian Wikipedia site.

mvonfrie’s picture

A small ix for patch #8: Change

$phonenumber = str_replace(array(' ','-','.','/','(',')'), '', $phonenumber);

to

$phonenumber = str_replace(array(' ','-','.','/','(0','(',')'), '', $phonenumber);

Add '(0', before '(', because many people write numbers like +43 (0) 5 123456 (where 05 is a special number prefix in Austria) or +43 (01) 123456 (01 is Vienna). If you remove just the ( the number becomes +4305123456 with the 0 making the number invalid.

lambic’s picture

Attaching a new patch that also includes romanian number checking

lambic’s picture

Title: Austrian phone number missing » Austrian and Romanian phone number missing
lambic’s picture

lambic’s picture

hmm bad patches sorry, will reroll

lambic’s picture

ok new patch, this time with phone.at.inc and phone.ro.inc

lambic’s picture

Adding the irish patch here too otherwise they won't apply together.

lambic’s picture