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.
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
Comment | File | Size | Author |
---|---|---|---|
#24 | phone-at-ro-ie-1605128-24.patch | 3.97 KB | lambic |
#23 | phone-at-ro-ie-1605128-23.patch | 3.97 KB | lambic |
#22 | phone-at-ro-1605128-22.patch | 4.28 KB | lambic |
#20 | phone-at-ro-1605128-18.patch | 1.38 KB | lambic |
#18 | phone-at-ro-1605128-18.patch | 1.75 KB | lambic |
Comments
Comment #1
steinmb CreditAttribution: steinmb commentedPls. 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.
Comment #2
mgiffordIsn'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.
Comment #3
steinmb CreditAttribution: steinmb commentedWrong country :) (Bush jr. also did this) Let's roll this (untested).
Comment #4
steinmb CreditAttribution: steinmb commentedComment #5
fagopatch file is empty.
Comment #6
fagotook the include, cleaned some code style only and rolled a proper patch. Also sorts countries so it's easier to find.
Comment #7
fago>Not sure what phone.at.inc is other than perhaps a typo.
lol. Yeah, austria != australia!
Comment #8
fagoTurned 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).
Comment #9
steinmb CreditAttribution: steinmb commentedOoobs, posted the wrong patch in #3, I'm such a moron :)
Comment #10
fago#8 works well for me. Any reviews or other testers?
Comment #11
rfsbsbThe 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.
Comment #12
BarwonHack CreditAttribution: BarwonHack commentedNot 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.
Comment #13
BarwonHack CreditAttribution: BarwonHack commentedComment #14
rfsbsbHi @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.
Comment #15
BarwonHack CreditAttribution: BarwonHack commentedHmmm, my bad ... misread Austrian as Australian. I'm down under. I'll create a new issue.
Comment #16
nerdoc CreditAttribution: nerdoc commentedI corrected the link to the Austrian Wikipedia site.
Comment #17
mvonfrie CreditAttribution: mvonfrie commentedA 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.Comment #18
lambic CreditAttribution: lambic at New/Mode commentedAttaching a new patch that also includes romanian number checking
Comment #19
lambic CreditAttribution: lambic at New/Mode commentedComment #20
lambic CreditAttribution: lambic at New/Mode commentedoops, removed the .info changes
Comment #21
lambic CreditAttribution: lambic at New/Mode commentedhmm bad patches sorry, will reroll
Comment #22
lambic CreditAttribution: lambic at New/Mode commentedok new patch, this time with phone.at.inc and phone.ro.inc
Comment #23
lambic CreditAttribution: lambic at New/Mode commentedAdding the irish patch here too otherwise they won't apply together.
Comment #24
lambic CreditAttribution: lambic at New/Mode commentedAdded start and end to irish regex