[open-ils-commits] [GIT] Evergreen ILS branch rel_2_12 updated. d5803023359dadd5169e24e71158e989f878a2eb

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_12 has been updated
       via  d5803023359dadd5169e24e71158e989f878a2eb (commit)
       via  750d1623ed594dbe81358ed4e34e11601aa0e96f (commit)
      from  9e36c70e4b56b0d2d470aac8d6a24c88da4546e5 (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 d5803023359dadd5169e24e71158e989f878a2eb
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 0df0ab0..f334f66 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm
@@ -380,7 +380,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 750d1623ed594dbe81358ed4e34e11601aa0e96f
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