From 4fc789e90bc31f98cd3adb3898ee2d5e23bca3b8 Mon Sep 17 00:00:00 2001 From: Cesar Velez Date: Wed, 16 Aug 2017 17:39:30 -0400 Subject: [PATCH] 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. To test ------- [1] In the web staff client, go to Item Status and enter an item barcode that is not present in the database. Note that no warning message displayed. [2] Apply the patch and repeat step 1. This tie, an 'Item Not Found' message is displayed. Signed-off by: Cesar Velez Signed-off-by: Galen Charlton --- Open-ILS/web/js/ui/default/staff/circ/services/item.js | 5 +++++ 1 file changed, 5 insertions(+) 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 28eae2a191..17d3269d81 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 @@ -99,7 +99,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() { @@ -122,6 +126,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 -- 2.43.2