repair precat checkouts; unit test repair
authorBill Erickson <berick@esilibrary.com>
Tue, 29 Jul 2014 17:05:03 +0000 (13:05 -0400)
committerBill Erickson <berick@esilibrary.com>
Tue, 29 Jul 2014 17:05:03 +0000 (13:05 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/web/js/ui/default/staff/circ/services/circ.js
Open-ILS/web/js/ui/default/staff/services/env.js

index 68401f1..edf975a 100644 (file)
@@ -486,25 +486,27 @@ function($modal , $q , egCore , egAlertDialog , egConfirmDialog) {
         if (!evt || !(payload = evt.payload)) return $q.when();
 
         promises.push(service.flesh_copy_location(payload.copy));
-        promises.push(
-            service.flesh_copy_status(payload.copy)
-
-            .then(function() {
-                // copy is in transit, but no transit was delivered
-                // in the payload.  Do this here instead of below to
-                // ensure consistent copy status fleshiness
-                if (!payload.transit && payload.copy.status().id() == 6) { // in-transit
-                    return service.find_copy_transit(evt, params, options)
-                    .then(function(trans) {
-                        if (trans) {
-                            trans.source(egCore.org.get(trans.source()));
-                            trans.dest(egCore.org.get(trans.dest()));
-                            payload.transit = trans;
-                        }
-                    })
-                }
-            })
-        );
+        if (payload.copy) {
+            promises.push(
+                service.flesh_copy_status(payload.copy)
+
+                .then(function() {
+                    // copy is in transit, but no transit was delivered
+                    // in the payload.  Do this here instead of below to
+                    // ensure consistent copy status fleshiness
+                    if (!payload.transit && payload.copy.status().id() == 6) { // in-transit
+                        return service.find_copy_transit(evt, params, options)
+                        .then(function(trans) {
+                            if (trans) {
+                                trans.source(egCore.org.get(trans.source()));
+                                trans.dest(egCore.org.get(trans.dest()));
+                                payload.transit = trans;
+                            }
+                        })
+                    }
+                })
+            );
+        }
 
         // local flesh transit
         if (transit = payload.transit) {
index fb1e120..25198fa 100644 (file)
@@ -59,8 +59,10 @@ function($q,  $window , egAuth,  egPCRUD,  egIDL) {
     // Currently defaults to /eg/staff for all pages.
     // Use $location.path() to jump around within an app.
     // Use egEnv.basePath to create URLs to new apps.
-    service.basePath = 
-        $window.document.getElementsByTagName('base')[0].getAttribute('href');
+    // NOTE: the dynamic version below derived from the DOM does not
+    // work w/ unit tests.  Use hard-coded value instead for now.
+    service.basePath = '/eg/staff/';
+        //$window.document.getElementsByTagName('base')[0].getAttribute('href');
 
     /* returns a promise, loads all of the specified classes */
     service.load = function() {