JBAS-1728 Avoid null email/print on batch renew fail
authorBill Erickson <berickxx@gmail.com>
Thu, 22 Jun 2017 15:28:47 +0000 (11:28 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
Avoid trying to email/print info about failed batch renewals, otherwise
the page gets stuck on logout.

Print/email info on failed batch renewals could be added, but to do so
means propagating circ IDs into the renewal functions.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/web/js/ui/kcls/circ/selfcheck/selfcheck.js

index 2dbb17b..d627379 100644 (file)
@@ -1223,7 +1223,15 @@ SelfCheckManager.prototype.handleXactResult = function(action, item, result) {
         popup = true;
         sound = 'checkout-failure';
 
-        if(action == 'renew')
+        // JBAS-1728
+        // this.prevCirc is only set when attempting to auto-renew
+        // an existing checkout.  It is not (currently) set when doing
+        // a straight up renewal.  This means renewal failures will only
+        // appear in receipts in the auto-renew context.  If we need to 
+        // add support for showing renewal failures to receipts in batch-
+        // renewal mode, see renewItems() and pass the circ ID in to use
+        // as the prevCirc value instead.
+        if(action == 'renew' && this.prevCirc)
             this.checkouts.push({circ : this.prevCirc, renewal_failure : true});
 
         if(result.length)