From: Cesar Velez Date: Wed, 16 Aug 2017 21:39:30 +0000 (-0400) Subject: LP#1683575 - Webstaff fix silent fail of bad barcodes in ItemStatus X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b85e77b6cfcb1975203d6812af281f6cee193d09;p=working%2FEvergreen.git LP#1683575 - Webstaff fix silent fail of bad barcodes in ItemStatus This address the current issue in master, that causes bad barcodes to fail silently. However, this patch is based on my refactor work from 1685929, which has not hit master yet. Thus, this depends on user/cesardv/lp1685929_Rebuilt_checkin_actions_itemSvc_Refactr Signed-off by: Cesar Velez --- diff --git a/Open-ILS/web/js/ui/default/staff/circ/services/item.js b/Open-ILS/web/js/ui/default/staff/circ/services/item.js index 23460807fb..a8298c9136 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/services/item.js +++ b/Open-ILS/web/js/ui/default/staff/circ/services/item.js @@ -95,7 +95,11 @@ function(egCore , egCirc , $uibModal , $q , $timeout , $window , egConfirmDialog return copyData; }); } + return fetchCopy(barcode, id).then(function(res) { + + if(!res.copy) { return $q.when(); } + return fetchCirc(copyData.copy).then(function(res) { if (copyData.circ) { return fetchSummary(copyData.circ).then(function() { @@ -118,6 +122,7 @@ function(egCore , egCirc , $uibModal , $q , $timeout , $window , egConfirmDialog return service.retrieveCopyData(barcode, id) .then(function(copyData) { + if(!copyData) { return $q.when(); } //Make sure we're getting a completed copyData - no plain acp or circ objects if (copyData.circ) { // flesh circ_lib locally