LP#1778567: don't return cached list/tree before updating
authorJeff Davis <jdavis@sitka.bclibraries.ca>
Tue, 7 Feb 2023 19:33:07 +0000 (11:33 -0800)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 12 May 2023 14:38:35 +0000 (10:38 -0400)
The absorbList function can be used to append items to an existing
cached list (and ditto for absorbTree), so we shouldn't start off by
returning the cached version.

Thanks to James Fournie for catching this.

Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
Signed-off-by: Ruth Frasur <rfrasur@library.in.gov>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/web/js/ui/default/staff/services/env.js

index 2d0f197..f82ef18 100644 (file)
@@ -96,8 +96,6 @@ function($q,  $window , $injector , egAuth,  egPCRUD,  egIDL) {
      *  flattens the tree for absorption.
      */
     service.absorbTree = function(tree, class_, noOffline) {
-        if (service[class_] && service[class_].loaded) return;
-
         var list = [];
         function squash(node) {
             list.push(node);
@@ -112,8 +110,6 @@ function($q,  $window , $injector , egAuth,  egPCRUD,  egIDL) {
 
     /** caches the object list both as the list and an id => object map */
     service.absorbList = function(list, class_, noOffline) {
-        if (service[class_] && service[class_].loaded) return service[class_];
-
         var blob;
         var pkey = egIDL.classes[class_].pkey;