From: Jason Stephenson Date: Wed, 22 May 2019 14:25:59 +0000 (-0400) Subject: LP 1830065: Remove Spaces and Punctuation from SMS Notify X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=48622520498ca02d390f1428a070796041fefd5d;p=working%2FEvergreen.git LP 1830065: Remove Spaces and Punctuation from SMS Notify We add a line of code to EGCatLoader::Account to strip spaces and punctuation from the user-entered SMS notify field. This way, the user doesn't have to worry so much about the input and they will get their SMS notifications, even if they enter the number with spaces and punctuation. We do not remove the SMS notificaiton hint as that is still somewhat useful information and sites may have customized this template. To test this, find something to put on hold and check the box for SMS notificaiton, enter a number in the field with spaces, dashes, or any other punctuation, and then look your hold up in the database. Prior to applying this commit, the action.hold_request.sms_notify field will contain the spaces and punctuation. After applying this commit and repeating the above steps, your next hold will not have punctuation or spaces in action.hold_request.sms_notify. No provision is made for cleaning up existing holds. Signed-off-by: Jason Stephenson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm index 3ec7900939..993174f039 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm @@ -1044,6 +1044,7 @@ sub load_place_hold { } if ($cgi->param('sms_notify_checkbox')) { $ctx->{sms_notify} = $cgi->param('sms_notify'); + $ctx->{sms_notify} =~ s/[[:punct:][:space:]]//g; $ctx->{sms_carrier} = $cgi->param('sms_carrier'); } diff --git a/docs/RELEASE_NOTES_NEXT/OPAC/sms_notify_cleanup.adoc b/docs/RELEASE_NOTES_NEXT/OPAC/sms_notify_cleanup.adoc new file mode 100644 index 0000000000..50bdcfa164 --- /dev/null +++ b/docs/RELEASE_NOTES_NEXT/OPAC/sms_notify_cleanup.adoc @@ -0,0 +1,12 @@ +Remove Spaces and Punctuation from SMS Notify +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Prior to the addition of this feature, if the user entered a SMS +number with spaces or punctuation in it when placing a hold, Evergreen +would accept the input but the SMS notification would never get sent. +The Evergreen OPAC now strips punctuation and spaces from the SMS +notificaiton number field when processing the data so that patrons and +staff do not have to worry aobut the format of the number that they +enter. + +No provision is made for cleaning up existing holds with invalid SMS +notification field values.