Librarians often copy and paste patron data, including phone numbers. SMS phone numbers are now being validated to conform to the E.164 specification. It would be nice to try to normalize that data by stripping non-numeric data from the paste (i.e. dashes, parens, etc ).
Created attachment 89458 [details] [review] Bug 22862 - Normalize SMS messaging numbers before validating them Librarians often copy and paste patron data, including phone numbers. SMS phone numbers are now being validated to conform to the E.164 specification. It would be nice to try to normalize that data by stripping non-numeric data from the paste (i.e. dashes, parens, etc ). Test Plan: 1) Apply this patch 2) On the staff side, Attempt to enter invalid characters the SMS number field 3) Note you cannot enter invalid characters 4) Attempt to paste a phone number with invalid characters 5) Note those characters are removed on paste 6) Repeat these steps on the OPAC
Created attachment 89474 [details] [review] Bug 22862: Normalize SMS messaging numbers before validating them Librarians often copy and paste patron data, including phone numbers. SMS phone numbers are now being validated to conform to the E.164 specification. It would be nice to try to normalize that data by stripping non-numeric data from the paste (i.e. dashes, parens, etc ). Test Plan: 1) Apply this patch 2) On the staff side, Attempt to enter invalid characters the SMS number field 3) Note you cannot enter invalid characters 4) Attempt to paste a phone number with invalid characters 5) Note those characters are removed on paste 6) Repeat these steps on the OPAC Signed-off-by: Liz Rea <wizzyrea@gmail.com>
A couple of things: 1. regexs are different 2. There is the 'pattern' attribute that should deal with that (opac-messaging.tt), can you explain why we need the JS code as well?
(In reply to Jonathan Druart from comment #3) > A couple of things: > 1. regexs are different I'll get that fixed. They are functionally identical, but it would be good to have them patch. > 2. There is the 'pattern' attribute that should deal with that > (opac-messaging.tt), can you explain why we need the JS code as well? The pattern attribute is for data validation, not data normalization.
Created attachment 89522 [details] [review] Bug 22862: (QA follow-up) Make regexes match
Could we maybe trigger the validation in a less 'intrusive' way? At the moment it will immediately delete a space entered, which is a little irritating maybe when you are still entering the data. I am not sure what would work better here for a trigger and I think this is also helpful as is, so passing QA.
Created attachment 89597 [details] [review] Bug 22862: Normalize SMS messaging numbers before validating them Librarians often copy and paste patron data, including phone numbers. SMS phone numbers are now being validated to conform to the E.164 specification. It would be nice to try to normalize that data by stripping non-numeric data from the paste (i.e. dashes, parens, etc ). Test Plan: 1) Apply this patch 2) On the staff side, Attempt to enter invalid characters the SMS number field 3) Note you cannot enter invalid characters 4) Attempt to paste a phone number with invalid characters 5) Note those characters are removed on paste 6) Repeat these steps on the OPAC Signed-off-by: Liz Rea <wizzyrea@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 89598 [details] [review] Bug 22862: (QA follow-up) Make regexes match Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Nice work! Pushed to master for 19.11.00
Pushed to 19.05.x for 19.05.03
lacking dependencies for 18.11.x, no backport