Many SMS messaging services reject numbers that do not conform to the E.164 international public telecommunication numbering plan. On the OPAC we already We already tell patrons on the OPAC "Please enter numbers only. (123) 456-7890 would be entered as 1234567890." but we do not enforce this. We should be validating the patron's SMS number on both the staff side and the patron self-service for updating the SMS number.
Created attachment 87068 [details] [review] Bug 22594 - Validate SMS messaging numbers using the E.164 format Many SMS messaging services reject numbers that do not conform to the E.164 international public telecommunication numbering plan. We already tell patrons on the OPAC "Please enter numbers only. (123) 456-7890 would be entered as 1234567890." but we do not enforce this. We should be validating the patron's SMS number on both the staff side and the patron self-service for updating the SMS number. Test plan: 1) Apply this patch 2) Enable SMS message ( you can set to Email to enable ) 3) Test entering and updating SMS numbers on the OPAC and staff interfaces. 4) Note you can only enter a 1 to 14 digit number with an optional + sign at the beginning ( used to indicate the number includes a country calling code )
*** Bug 21623 has been marked as a duplicate of this bug. ***
This looks like it's working well but I think the staff client deserves a friendly hint like the OPAC has. Nobody knows what "E.164 format" means. What about adding this: <div class="hint">SMS number should be in the format 1234567890 or +1234567890</div> ...And changing the validator message to simply "Please enter a valid phone number."
Created attachment 87073 [details] [review] Bug 22594 - Validate SMS messaging numbers using the E.164 format Many SMS messaging services reject numbers that do not conform to the E.164 international public telecommunication numbering plan. We already tell patrons on the OPAC "Please enter numbers only. (123) 456-7890 would be entered as 1234567890." but we do not enforce this. We should be validating the patron's SMS number on both the staff side and the patron self-service for updating the SMS number. Test plan: 1) Apply this patch 2) Enable SMS message ( you can set to Email to enable ) 3) Test entering and updating SMS numbers on the OPAC and staff interfaces. 4) Note you can only enter a 1 to 14 digit number with an optional + sign at the beginning ( used to indicate the number includes a country calling code )
Created attachment 87122 [details] [review] Bug 22594: Validate SMS messaging numbers using the E.164 format Many SMS messaging services reject numbers that do not conform to the E.164 international public telecommunication numbering plan. We already tell patrons on the OPAC "Please enter numbers only. (123) 456-7890 would be entered as 1234567890." but we do not enforce this. We should be validating the patron's SMS number on both the staff side and the patron self-service for updating the SMS number. Test plan: 1) Apply this patch 2) Enable SMS message ( you can set to Email to enable ) 3) Test entering and updating SMS numbers on the OPAC and staff interfaces. 4) Note you can only enter a 1 to 14 digit number with an optional + sign at the beginning ( used to indicate the number includes a country calling code ) Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Created attachment 87287 [details] [review] Bug 22594: Validate SMS messaging numbers using the E.164 format Many SMS messaging services reject numbers that do not conform to the E.164 international public telecommunication numbering plan. We already tell patrons on the OPAC "Please enter numbers only. (123) 456-7890 would be entered as 1234567890." but we do not enforce this. We should be validating the patron's SMS number on both the staff side and the patron self-service for updating the SMS number. Test plan: 1) Apply this patch 2) Enable SMS message ( you can set to Email to enable ) 3) Test entering and updating SMS numbers on the OPAC and staff interfaces. 4) Note you can only enter a 1 to 14 digit number with an optional + sign at the beginning ( used to indicate the number includes a country calling code ) Signed-off-by: Liz Rea <wizzyrea@gmail.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Awesome work all! Pushed to master for 19.05
Enhancement will not be backported to 18.11.x series.
Unfortunately, this doesn't seem to closely follow E.164, and it actually breaks validation for any Australian phone number that doesn't have a country code (e.g. 02 5555 5555), since this patch doesn't let a phone number start with a 0.
(In reply to David Cook from comment #9) > Unfortunately, this doesn't seem to closely follow E.164, and it actually > breaks validation for any Australian phone number that doesn't have a > country code (e.g. 02 5555 5555), since this patch doesn't let a phone > number start with a 0. Patch ready on Bug 26285.