From a4c297a0fb4b0acb6d45ab337a202738bd67ea9a Mon Sep 17 00:00:00 2001 From: dbs Date: Thu, 22 Jul 2010 16:37:56 +0000 Subject: [PATCH] Handle the situation where no copy is found. Correctly. git-svn-id: svn://svn.open-ils.org/ILS-Contrib/conifer/branches/rel_1_6_0@935 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- web/js/ui/default/cat/storage/move.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/web/js/ui/default/cat/storage/move.js b/web/js/ui/default/cat/storage/move.js index 6b8a90ae85..f595a25a7e 100644 --- a/web/js/ui/default/cat/storage/move.js +++ b/web/js/ui/default/cat/storage/move.js @@ -43,15 +43,14 @@ function moveCopy(barcode) { return; } - copy = pcrud.search("acp", {"barcode": barcode}); - if (!copy) { - dojo.place('
Barcode [' + barcode + '] was not found!
', 'resultsDiv', 'only'); - return; - } copy = fieldmapper.standardRequest( ['open-ils.search', 'open-ils.search.asset.copy.find_by_barcode'], {params: [barcode]} ); + if (!copy.location) { + dojo.place('
Barcode [' + barcode + '] was not found!
', 'resultsDiv', 'only'); + return; + } copy.location(152); copy.ischanged(1); pcrud.update(copy); -- 2.11.0