From: Bill Erickson Date: Tue, 29 Jul 2014 17:05:03 +0000 (-0400) Subject: repair precat checkouts; unit test repair X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c337f1043387852a75803e5b5594ee16abda4e88;p=working%2FEvergreen.git repair precat checkouts; unit test repair Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/web/js/ui/default/staff/circ/services/circ.js b/Open-ILS/web/js/ui/default/staff/circ/services/circ.js index 68401f14b8..edf975a23a 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/services/circ.js +++ b/Open-ILS/web/js/ui/default/staff/circ/services/circ.js @@ -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) { diff --git a/Open-ILS/web/js/ui/default/staff/services/env.js b/Open-ILS/web/js/ui/default/staff/services/env.js index fb1e120c34..25198fae7c 100644 --- a/Open-ILS/web/js/ui/default/staff/services/env.js +++ b/Open-ILS/web/js/ui/default/staff/services/env.js @@ -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() {