[open-ils-commits] [GIT] Evergreen ILS branch rel_3_0 updated. e9e53187c14390ae2213c22a9d8b8bcd1c4a71ba

Evergreen Git git at git.evergreen-ils.org
Thu Oct 11 13:27:38 EDT 2018


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_0 has been updated
       via  e9e53187c14390ae2213c22a9d8b8bcd1c4a71ba (commit)
      from  bbbafc4936ef4734e05a5e9a701562472140d498 (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 e9e53187c14390ae2213c22a9d8b8bcd1c4a71ba
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Thu Oct 11 09:21:05 2018 -0400

    LP#1796971 Wait for call number and copy before loading locations
    
    In cases where add a copy to a call number, we fetch the original
    call number via async, then attach the new copy to it.  Before this
    commit, however, we were not waiting for the call number fetch
    promise to resolve, so the copy wasn't there to use for limiting the
    location load.
    
    Since the async request is internal to a loop, one way out is to
    capture that promise, then make sure it resolves before loading the
    locations.
    
    (We previously returned the copies from the internal function, but that
    value wasn't being used anyway, so we don't worry about unwrapping the
    $q.all() when it resolves.)
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
    Signed-off-by: John Amundson <jamundson at cwmars.org>
    Signed-off-by: Jason Stephenson <jason at sigio.com>

diff --git a/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js b/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js
index 2544c17..682e0cd 100644
--- a/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js
+++ b/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js
@@ -1415,12 +1415,13 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
                      * All can be left out and a completely empty vol/copy combo will be vivicated.
                      */
 
+                    var promises = [];
                     angular.forEach(
                         data.raw,
                         function (proto) {
                             if (proto.fast_add) $scope.is_fast_add = true;
                             if (proto.callnumber) {
-                                return egCore.pcrud.retrieve('acn', proto.callnumber)
+                                promises.push(egCore.pcrud.retrieve('acn', proto.callnumber)
                                 .then(function(cn) {
                                     var cp = new itemSvc.generateNewCopy(
                                         cn,
@@ -1435,7 +1436,7 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
                                     }
 
                                     itemSvc.addCopy(cp)
-                                });
+                                }));
                             } else {
                                 var cn = new egCore.idl.acn();
                                 cn.id( --itemSvc.new_cn_id );
@@ -1494,7 +1495,15 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
                         }
                     );
 
-                    return itemSvc.copies;
+                    angular.forEach(itemSvc.copies, function(c){
+                        var cn = c.call_number();
+                        var copy_id = c.id();
+                        if (copy_id > 0){
+                            cn.not_ephemeral = true;
+                        }
+                    });
+
+                    return $q.all(promises);
                 }
 
                 if (data.copies && data.copies.length)

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

Summary of changes:
 .../web/js/ui/default/staff/cat/volcopy/app.js     |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list