LP1904036 Checkin data collection race condition fix (printing hold slips)
authorBill Erickson <berickxx@gmail.com>
Fri, 21 Jan 2022 21:47:03 +0000 (16:47 -0500)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:40 +0000 (20:13 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>

Open-ILS/src/eg2/src/app/staff/share/circ/circ.service.ts

index 636af45..0a66be4 100644 (file)
@@ -797,7 +797,7 @@ export class CircService {
             (nonCatCirc ? nonCatCirc.patron() : null);
 
         if (circPatronId) {
-            console.debug('fleshCommonData() circ ', circPatronId);
+            console.debug('fleshCommonData() circ patron id', circPatronId);
             promise = promise.then(_ => {
                 return this.fetchPatron(circPatronId)
                 .then(usr => {
@@ -827,10 +827,12 @@ export class CircService {
             if (this.copyLocationCache[copy.location()]) {
                 copy.location(this.copyLocationCache[copy.location()]);
             } else {
-                promise = this.pcrud.retrieve('acpl', copy.location()).toPromise()
-                .then(loc => {
-                    copy.location(loc);
-                    this.copyLocationCache[loc.id()] = loc;
+                promise = promise.then(_ => {
+                    return this.pcrud.retrieve('acpl', copy.location())
+                    .toPromise().then(loc => {
+                        copy.location(loc);
+                        this.copyLocationCache[loc.id()] = loc;
+                    });
                 });
             }