[open-ils-commits] [GIT] Evergreen ILS branch rel_3_4 updated. f594911fc97dc53035f871e68507fa6e646320ae

Evergreen Git git at git.evergreen-ils.org
Sun Jul 12 11:34:04 EDT 2020


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_3_4 has been updated
       via  f594911fc97dc53035f871e68507fa6e646320ae (commit)
      from  e6160c20dfa79b82eb392e857dbb8132f8c355b1 (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 f594911fc97dc53035f871e68507fa6e646320ae
Author: Jason Boyer <JBoyer at eoli.info>
Date:   Fri Feb 21 16:08:36 2020 -0500

    LP1864056: Don't compare multiple new Date()s
    
    This branch addresses a race condition when
    checking out or renewing items.
    (The use of minDate in items_out was implicitly
    immune to this issue, but that is made explicit
    with this patch.)
    
    To test
    -------
    [1] The race condition would be difficult to reliably
        reproduce directly, although a tool like
        https://github.com/mattzeunert/javascript-clock-speedup
        might help simulate the problem, so to test, verify
        that the following actions do not break:
    
        * checking out a loan, both with and without
          setting a specific due date
        * renewing a loan with a specific due date
          from the patron items out tab
        * renewing a loan from Circulation -> Renew Items,
          both with and without setting a specific due date.
    
    Signed-off-by: Jason Boyer <JBoyer at eoli.info>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
    Signed-off-by: Jane Sandberg <sandbej at linnbenton.edu>

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 7984b795e9..fa7470cf7b 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
@@ -9,6 +9,7 @@ angular.module('egPatronApp').controller('PatronCheckoutCtrl',
 
 function($scope , $q , $routeParams , egCore , egUser , patronSvc , 
          egGridDataProvider , $location , $timeout , egCirc , ngToast) {
+    var now = new Date();
 
     $scope.initTab('checkout', $routeParams.id).finally(function(){
         $scope.focusMe = true;
@@ -16,10 +17,10 @@ function($scope , $q , $routeParams , egCore , egUser , patronSvc ,
     $scope.checkouts = patronSvc.checkouts;
     $scope.checkoutArgs = {
         noncat_type : 'barcode',
-        due_date : new Date()
+        due_date : new Date(now)
     };
 
-    $scope.minDate = new Date();
+    $scope.minDate = new Date(now);
     $scope.outOfRange = false;
     $scope.gridDataProvider = egGridDataProvider.instance({
         get : function(offset, count) {
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 96cc65cd6b..9514f16f7d 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
@@ -483,11 +483,12 @@ function($scope , $q , $routeParams , $timeout , egCore , egUser , patronSvc ,
             controller : [
                         '$scope','$uibModalInstance',
                 function($scope , $uibModalInstance) {
+                    var now = new Date();
                     $scope.outOfRange = false;
-                    $scope.minDate = new Date();
+                    $scope.minDate = new Date(now);
                     $scope.args = {
                         barcodes : barcodes,
-                        date : new Date()
+                        date : new Date(now)
                     }
                     $scope.cancel = function() {$uibModalInstance.dismiss()}
 
diff --git a/Open-ILS/web/js/ui/default/staff/circ/renew/app.js b/Open-ILS/web/js/ui/default/staff/circ/renew/app.js
index e15dd5e7be..2f57728e14 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/renew/app.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/renew/app.js
@@ -32,16 +32,16 @@ angular.module('egRenewApp',
 .controller('RenewCtrl',
        ['$scope','$window','$location','egCore','egGridDataProvider','egCirc',
 function($scope , $window , $location , egCore , egGridDataProvider , egCirc) {
+    var now = new Date();
 
     egCore.hatch.getItem('circ.renew.strict_barcode')
         .then(function(sb){ $scope.strict_barcode = sb });
     $scope.focusBarcode = true;
     $scope.outOfRange = false;
-    $scope.minDate = new Date();
+    $scope.minDate = new Date(now);
     $scope.renewals = [];
 
-    var today = new Date();
-    $scope.renewalArgs = {due_date : today};
+    $scope.renewalArgs = {due_date : new Date(now)};
 
     $scope.sort_money = function (a,b) {
         var ma = parseFloat(a);

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

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


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list