[open-ils-commits] [GIT] Evergreen ILS branch master updated. 78389b7bc689069cec741b583cb1bd8b6353a161

Evergreen Git git at git.evergreen-ils.org
Thu May 23 17:26:45 EDT 2019


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, master has been updated
       via  78389b7bc689069cec741b583cb1bd8b6353a161 (commit)
      from  25dfa52a76c1a4b5d022fa1090a7d8b06a346249 (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 78389b7bc689069cec741b583cb1bd8b6353a161
Author: Jason Boyer <jboyer at library.in.gov>
Date:   Thu Feb 7 13:48:13 2019 -0500

    LP1790896: Receipt Errors with invalid emails
    
    The attempt at belt-and-suspenders checking for a valid
    email for use in the has_email template field sadly
    causes the JS to trip over said suspenders if there is
    a value in the field but it doesn't contain a '@'.
    
    The raw return from "".match() (either an array or null)
    is enough to do the right thing when converted into a
    Boolean and doesn't cause the same problems.
    
    To test
    -------
    [1] Set up a patron record with an invalid email address,
        e.g., one that lacks the '@' character.
    [2] Check out an item the patron, then from the Items Out
        tab, print an item receipt.
    [3] Note that nothing happens and an error is logged in the
        browser console.
    [4] Apply the patch and repeat step 2. This time, a receipt
        should be generated.
    
    Signed-off-by: Jason Boyer <jboyer at library.in.gov>
    Signed-off-by: Josh Stompro <stompro at stompro.org>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js b/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js
index ceda5c82d4..9ec2e89e53 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js
@@ -450,7 +450,7 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
             card : { barcode : cusr.card().barcode() },
             expire_date : cusr.expire_date(),
             alias : cusr.alias(),
-            has_email : Boolean(patronSvc.current.email() && patronSvc.current.email().match(/.*@.*/).length),
+            has_email : Boolean(patronSvc.current.email() && patronSvc.current.email().match(/.*@.*/)),
             has_phone : Boolean(cusr.day_phone() || cusr.evening_phone() || cusr.other_phone())
         };
 
@@ -587,7 +587,7 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
                             card : { barcode : cusr.card().barcode() },
                             expire_date : cusr.expire_date(),
                             alias : cusr.alias(),
-                            has_email : Boolean(cusr.email() && cusr.email().match(/.*@.*/).length),
+                            has_email : Boolean(cusr.email() && cusr.email().match(/.*@.*/)),
                             has_phone : Boolean(cusr.day_phone() || cusr.evening_phone() || cusr.other_phone())
                         }
                     }
@@ -1086,7 +1086,7 @@ function($scope,  $q , egCore , patronSvc , billSvc , egPromptDialog , $location
                             card : { barcode : cusr.card().barcode() },
                             expire_date : cusr.expire_date(),
                             alias : cusr.alias(),
-                            has_email : Boolean(cusr.email() && cusr.email().match(/.*@.*/).length),
+                            has_email : Boolean(cusr.email() && cusr.email().match(/.*@.*/)),
                             has_phone : Boolean(cusr.day_phone() || cusr.evening_phone() || cusr.other_phone())
                         }
                     }
diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js b/Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js
index 1cbb05e220..ba7c5453bb 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js
@@ -96,7 +96,7 @@ function($scope , $q , $routeParams , egCore , egUser , patronSvc ,
         return (
             patronSvc.current &&
             patronSvc.current.email() &&
-            patronSvc.current.email().match(/.*@.*/).length
+            patronSvc.current.email().match(/.*@.*/)
         );
     }
 
diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js b/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js
index 110ead8585..92184a11fa 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js
@@ -383,7 +383,7 @@ function($scope , $q , $routeParams , $timeout , egCore , egUser , patronSvc ,
             money_summary : patronSvc.patron_stats.fines,
             expire_date : cusr.expire_date(),
             alias : cusr.alias(),
-            has_email : Boolean(patronSvc.current.email() && patronSvc.current.email().match(/.*@.*/).length),
+            has_email : Boolean(patronSvc.current.email() && patronSvc.current.email().match(/.*@.*/)),
             has_phone : Boolean(cusr.day_phone() || cusr.evening_phone() || cusr.other_phone())
         };
 

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

Summary of changes:
 Open-ILS/web/js/ui/default/staff/circ/patron/bills.js     | 6 +++---
 Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js  | 2 +-
 Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list