[Bug 26285] New: Use country code + number (E.164) validation for SMS numbers
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26285 Bug ID: 26285 Summary: Use country code + number (E.164) validation for SMS numbers Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: dcook@prosentient.com.au QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com According to the E.164 standard, a phone number must be a maximum of 12 digits plus a 1-3 digit country code for a maximum of 15 digits. For North America, that would look like +1 306 555 5555 (11 total digits) or 306 555 5555 (10 digits). For Australian phone numbers, that looks like +61 2 5555 5555 (11 total digits) or 02 5555 5555 (10 digits). Unfortunately, since Bug 22594, Australian phone numbers without a country code aren't validating because they start with a 0. Further reading: https://en.wikipedia.org/wiki/E.164 https://www.itu.int/rec/T-REC-E.164/ https://en.wikipedia.org/wiki/List_of_country_calling_codes -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26285 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |22594 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22594 [Bug 22594] Validate SMS messaging numbers using the E.164 format -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26285 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |dcook@prosentient.com.au |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26285 --- Comment #1 from David Cook <dcook@prosentient.com.au> --- Created attachment 108964 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=108964&action=edit Bug 26285: Follow E.164 pattern for validating SMS numbers Currently, Koha is not correctly validating SMS numbers using E.164. This causes Australian phone numbers without a country code to fail validation. This patch uses the E.164 pattern of 1-3 digits for country code, prefixed by a + symbol, and followed by up to 12 digits for the remainder of the phone number. To test: 0. Don't apply patch yet 1. Set "SMSSendDriver" to "Anything" 2. Go to http://localhost:8081/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=51 3. Type in 0455555555 and note "Please enter a valid phone number." message in browser 6. Apply the patch 7. Go to http://localhost:8081/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=51 8. Type in 0455555555 and note no validation error 9. Type in +61455555555 and note no validation error 10. Type in 123456789012 and note no validation error 11. Type in 1234567890123 and note "Please enter a valid phone number." error 12. Type in +900123456789012 and note no validation error 13. Type in 900123456789012 and note "Please enter a valid phone number." error -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26285 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26285 ByWater Sandboxes <bws.sandboxes@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #108964|0 |1 is obsolete| | --- Comment #2 from ByWater Sandboxes <bws.sandboxes@gmail.com> --- Created attachment 108979 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=108979&action=edit Bug 26285: Follow E.164 pattern for validating SMS numbers Currently, Koha is not correctly validating SMS numbers using E.164. This causes Australian phone numbers without a country code to fail validation. This patch uses the E.164 pattern of 1-3 digits for country code, prefixed by a + symbol, and followed by up to 12 digits for the remainder of the phone number. To test: 0. Don't apply patch yet 1. Set "SMSSendDriver" to "Anything" 2. Go to http://localhost:8081/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=51 3. Type in 0455555555 and note "Please enter a valid phone number." message in browser 6. Apply the patch 7. Go to http://localhost:8081/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=51 8. Type in 0455555555 and note no validation error 9. Type in +61455555555 and note no validation error 10. Type in 123456789012 and note no validation error 11. Type in 1234567890123 and note "Please enter a valid phone number." error 12. Type in +900123456789012 and note no validation error 13. Type in 900123456789012 and note "Please enter a valid phone number." error Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26285 Sally <sally.healey@cheshiresharedservices.gov.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sally.healey@cheshireshared | |services.gov.uk Status|Needs Signoff |Signed Off --- Comment #3 from Sally <sally.healey@cheshiresharedservices.gov.uk> --- This is valid for UK patrons too - our mobile numbers also start with zero. Test plan works, signed off! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26285 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26285 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #108979|0 |1 is obsolete| | --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 109034 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109034&action=edit Bug 26285: Follow E.164 pattern for validating SMS numbers Currently, Koha is not correctly validating SMS numbers using E.164. This causes Australian phone numbers without a country code to fail validation. This patch uses the E.164 pattern of 1-3 digits for country code, prefixed by a + symbol, and followed by up to 12 digits for the remainder of the phone number. To test: 0. Don't apply patch yet 1. Set "SMSSendDriver" to "Anything" 2. Go to http://localhost:8081/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=51 3. Type in 0455555555 and note "Please enter a valid phone number." message in browser 6. Apply the patch 7. Go to http://localhost:8081/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=51 8. Type in 0455555555 and note no validation error 9. Type in +61455555555 and note no validation error 10. Type in 123456789012 and note no validation error 11. Type in 1234567890123 and note "Please enter a valid phone number." error 12. Type in +900123456789012 and note no validation error 13. Type in 900123456789012 and note "Please enter a valid phone number." error Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26285 --- Comment #5 from David Cook <dcook@prosentient.com.au> --- (In reply to Sally from comment #3)
This is valid for UK patrons too - our mobile numbers also start with zero.
Test plan works, signed off!
Thanks Sally (and Katrin)! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26285 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org Status|Passed QA |Failed QA --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- What about the OPAC? Bug 22594 modified opac-messaging with the same regex: 135 <label for="SMSnumber">SMS number:</label> <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber | html %]" pattern="^\+?[1-9]\d{1,14}$" /> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26285 --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Jonathan Druart from comment #6)
What about the OPAC? Bug 22594 modified opac-messaging with the same regex:
135 <label for="SMSnumber">SMS number:</label> <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber | html %]" pattern="^\+?[1-9]\d{1,14}$" />
Hah! I checked the OPAC but expected it to use the same names... wrong! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26285 --- Comment #8 from David Cook <dcook@prosentient.com.au> --- Ah, thanks for that one, Jonathan. I'll look at updating this later today. Didn't even notice that the same code isn't re-used between interfaces. Have to love having more than 1 way to do the same thing... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26285 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26285 --- Comment #9 from David Cook <dcook@prosentient.com.au> --- Created attachment 109135 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109135&action=edit Bug 26285: Follow E.164 pattern for OPAC too This patch uses the E.164 pattern for phone numbers for the OPAC (and not just the staff interface). To test: 0) Follow the same plan as the staff interface, but go to /cgi-bin/koha/opac-messaging.pl after logging into the OPAC -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26285 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=26299 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26285 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com CC| |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26285 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #109034|0 |1 is obsolete| | --- Comment #10 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 109542 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109542&action=edit Bug 26285: Follow E.164 pattern for validating SMS numbers Currently, Koha is not correctly validating SMS numbers using E.164. This causes Australian phone numbers without a country code to fail validation. This patch uses the E.164 pattern of 1-3 digits for country code, prefixed by a + symbol, and followed by up to 12 digits for the remainder of the phone number. To test: 0. Don't apply patch yet 1. Set "SMSSendDriver" to "Anything" 2. Go to http://localhost:8081/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=51 3. Type in 0455555555 and note "Please enter a valid phone number." message in browser 6. Apply the patch 7. Go to http://localhost:8081/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=51 8. Type in 0455555555 and note no validation error 9. Type in +61455555555 and note no validation error 10. Type in 123456789012 and note no validation error 11. Type in 1234567890123 and note "Please enter a valid phone number." error 12. Type in +900123456789012 and note no validation error 13. Type in 900123456789012 and note "Please enter a valid phone number." error Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26285 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #109135|0 |1 is obsolete| | --- Comment #11 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 109543 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109543&action=edit Bug 26285: Follow E.164 pattern for OPAC too This patch uses the E.164 pattern for phone numbers for the OPAC (and not just the staff interface). To test: 0) Follow the same plan as the staff interface, but go to /cgi-bin/koha/opac-messaging.pl after logging into the OPAC Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26285 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #12 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Works as expected for me.. and I believe is now consistent OPAC and Staff side. Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26285 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26285 --- Comment #13 from David Cook <dcook@prosentient.com.au> --- (In reply to Martin Renvoize from comment #12)
Works as expected for me.. and I believe is now consistent OPAC and Staff side.
Passing QA
Cheers Martin :D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26285 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |20.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26285 --- Comment #14 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 20.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org