[open-ils-commits] [GIT] Evergreen ILS branch rel_2_11 updated. c801e88957518d29c8a32d79977c7a68496b08ff

Evergreen Git git at git.evergreen-ils.org
Tue Jun 20 14:50:47 EDT 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_2_11 has been updated
       via  c801e88957518d29c8a32d79977c7a68496b08ff (commit)
       via  96ea98c669bf7131eae52e4d3adc8eeaf2d11961 (commit)
      from  7dddee8e2fc781f7f7860a990b5364cc5f50dffe (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c801e88957518d29c8a32d79977c7a68496b08ff
Author: Chris Sharp <csharp at georgialibraries.org>
Date:   Wed May 31 08:22:58 2017 -0400

    LP#1694696 - Check for blank SMS Carriers in A/T reactor
    
    Currently, the get_sms_gateway_email subroutine does not check
    for the truthiness of sms_carrier, which can result in catastrophic
    failure for a running server.  This adds that check.
    
    Signed-off-by: Chris Sharp <csharp at georgialibraries.org>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm
index 7b96edb..9e0ab9a 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm
@@ -373,7 +373,7 @@ $_TT_helpers = {
         my $sms_carrier = shift;
         my $sms_notify = shift;
 
-        if (! defined $sms_notify || $sms_notify eq '') {
+        if (! defined $sms_notify || $sms_notify eq '' || ! defined $sms_carrier || $sms_carrier eq '') {
             return '';
         }
 

commit 96ea98c669bf7131eae52e4d3adc8eeaf2d11961
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Tue Jun 20 14:56:43 2017 -0400

    LP#1694696: add some unit tests for A/T helpers
    
    In particular, start with get_sms_gateway_email().
    
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/perlmods/live_t/23-action-trigger-templates.t b/Open-ILS/src/perlmods/live_t/23-action-trigger-templates.t
new file mode 100644
index 0000000..cd71d82
--- /dev/null
+++ b/Open-ILS/src/perlmods/live_t/23-action-trigger-templates.t
@@ -0,0 +1,37 @@
+#!perl
+
+use strict;
+use warnings;
+use Test::More tests => 3;
+use OpenILS::Utils::TestUtils;
+use OpenILS::Const qw(:const);
+
+my $script = OpenILS::Utils::TestUtils->new();
+$script->bootstrap;
+
+use OpenILS::Application::Trigger::Reactor;
+my $r = "OpenILS::Application::Trigger::Reactor";
+
+my $env = {
+    carrier  => 1,
+    number   => '',
+    template => '[%- helpers.get_sms_gateway_email(carrier, number) -%]',
+};
+my $addr = $r->run_TT($env, 1);
+is($addr, '', 'helpers.get_sms_gateway_email: no number means no SMS gateway address');
+
+$env = {
+    carrier  => 1,
+    number   => '9015551212',
+    template => '[%- helpers.get_sms_gateway_email(carrier, number) -%]',
+};
+$addr = $r->run_TT($env, 1);
+is($addr, 'opensrf+9015551212 at localhost', 'helpers.get_sms_gateway_email: get back a SMS gateway address');
+
+$env = {
+    carrier  => '',
+    number   => '9015551212',
+    template => '[%- helpers.get_sms_gateway_email(carrier, number) -%]',
+};
+$addr = $r->run_TT($env, 1);
+is($addr, '', 'helpers.get_sms_gateway_email: no carrier means no SMS gateway address');

-----------------------------------------------------------------------

Summary of changes:
 .../lib/OpenILS/Application/Trigger/Reactor.pm     |    2 +-
 .../perlmods/live_t/23-action-trigger-templates.t  |   37 ++++++++++++++++++++
 2 files changed, 38 insertions(+), 1 deletions(-)
 create mode 100644 Open-ILS/src/perlmods/live_t/23-action-trigger-templates.t


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list