From da51080f6656b67b703355d103b84c6767055575 Mon Sep 17 00:00:00 2001 From: phasefx Date: Fri, 1 Feb 2008 14:36:26 +0000 Subject: [PATCH] sidestep race condition with new volumes and db replication.. this should fix the Stat Cat popup errors, but we need to test on weezie git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_2_1@8567 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/xul/staff_client/server/cat/copy_editor.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/cat/copy_editor.js b/Open-ILS/xul/staff_client/server/cat/copy_editor.js index 0498dc1382..66d7d8fb87 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_editor.js +++ b/Open-ILS/xul/staff_client/server/cat/copy_editor.js @@ -554,7 +554,12 @@ g.get_acpl_list = function() { var cn_id = g.copies[i].call_number(); if (cn_id > 0) { if (! g.map_acn[ cn_id ]) { - g.map_acn[ cn_id ] = g.network.simple_request('FM_ACN_RETRIEVE',[ cn_id ]); + var req = g.network.simple_request('FM_ACN_RETRIEVE',[ cn_id ]); + if (typeof req.ilsevent == 'undefined') { + g.map_acn[ cn_id ] = req; + } else { + continue; + } } var consider_lib = g.map_acn[ cn_id ].owning_lib(); if ( libs.indexOf( String( consider_lib ) ) > -1 ) { /* already in list */ } else { libs.push( consider_lib ); } @@ -1228,6 +1233,7 @@ g.copy_notes = function() { /******************************************************************************************************/ /* hides or unhides stat cats based on library stat cat filter menu */ g.toggle_stat_cat_display = function(el) { + if (!el) return; var visible = el.getAttribute('checked'); var nl = document.getElementsByAttribute('sc_lib',el.getAttribute('value')); for (var n = 0; n < nl.length; n++) { @@ -1383,7 +1389,13 @@ g.populate_stat_cats = function() { var cn_id = g.copies[i].call_number(); if (cn_id > 0) { if (! g.map_acn[ cn_id ]) { - g.map_acn[ cn_id ] = g.network.simple_request('FM_ACN_RETRIEVE',[ cn_id ]); + var req = g.network.simple_request('FM_ACN_RETRIEVE',[ cn_id ]); + if (typeof req.ilsevent == 'undefined') { + g.map_acn[ cn_id ] = req; + } else { + continue; + } + } var owning_lib = g.map_acn[ cn_id ].owning_lib(); if (typeof owning_lib == 'object') owning_lib = owning_lib.id(); sc_libs[ owning_lib ] = true; -- 2.11.0