[open-ils-commits] r935 - conifer/branches/rel_1_6_0/web/js/ui/default/cat/storage (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Jul 22 12:38:00 EDT 2010


Author: dbs
Date: 2010-07-22 12:37:56 -0400 (Thu, 22 Jul 2010)
New Revision: 935

Modified:
   conifer/branches/rel_1_6_0/web/js/ui/default/cat/storage/move.js
Log:
Handle the situation where no copy is found. Correctly.


Modified: conifer/branches/rel_1_6_0/web/js/ui/default/cat/storage/move.js
===================================================================
--- conifer/branches/rel_1_6_0/web/js/ui/default/cat/storage/move.js	2010-07-22 15:22:36 UTC (rev 934)
+++ conifer/branches/rel_1_6_0/web/js/ui/default/cat/storage/move.js	2010-07-22 16:37:56 UTC (rev 935)
@@ -43,15 +43,14 @@
         return;
     }
 
-    copy = pcrud.search("acp", {"barcode": barcode});
-    if (!copy) {
-       dojo.place('<div class="alert">Barcode [' + barcode + '] was not found!</div>', 'resultsDiv', 'only');
-       return;
-    }
     copy = fieldmapper.standardRequest(
         ['open-ils.search', 'open-ils.search.asset.copy.find_by_barcode'],
         {params: [barcode]}
     );
+    if (!copy.location) {
+       dojo.place('<div class="alert">Barcode [' + barcode + '] was not found!</div>', 'resultsDiv', 'only');
+       return;
+    }
     copy.location(152);
     copy.ischanged(1);
     pcrud.update(copy);



More information about the open-ils-commits mailing list