LP 1830065: Remove Spaces and Punctuation from SMS Notify user/dyrcona/lp1830065-clean-sms-notify
authorJason Stephenson <jason@sigio.com>
Wed, 22 May 2019 14:25:59 +0000 (10:25 -0400)
committerJason Stephenson <jason@sigio.com>
Wed, 22 May 2019 14:32:59 +0000 (10:32 -0400)
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 <jason@sigio.com>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
docs/RELEASE_NOTES_NEXT/OPAC/sms_notify_cleanup.adoc [new file with mode: 0644]

index 3ec7900..993174f 100644 (file)
@@ -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 (file)
index 0000000..50bdcfa
--- /dev/null
@@ -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.