From e9581e5847b3fbd034a6bed7668979dcf0d33282 Mon Sep 17 00:00:00 2001 From: dbs Date: Thu, 19 Mar 2009 01:49:51 +0000 Subject: [PATCH] Backport r12586 from trunk to prevent 'Replace Barcode' from trying to set a barcode to 'null' on Cancel git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_4_0@12591 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/xul/staff_client/chrome/content/main/menu.js | 3 ++- Open-ILS/xul/staff_client/server/cat/util.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Open-ILS/xul/staff_client/chrome/content/main/menu.js b/Open-ILS/xul/staff_client/chrome/content/main/menu.js index 20d7283470..0bdfe33174 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/menu.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/menu.js @@ -130,7 +130,8 @@ main.menu.prototype = { var new_bc = window.prompt(offlineStrings.getString('menu.cmd_replace_barcode.replacement.prompt'),'',offlineStrings.getString('menu.cmd_replace_barcode.replacement.label')); new_bc = String( new_bc ).replace(/\s/g,''); - if (!new_bc) { + /* Casting a possibly null input value to a String turns it into "null" */ + if (!new_bc || new_bc == 'null') { alert(offlineStrings.getString('menu.cmd_replace_barcode.blank.error')); return; } diff --git a/Open-ILS/xul/staff_client/server/cat/util.js b/Open-ILS/xul/staff_client/server/cat/util.js index f7bd37692b..d730e32458 100644 --- a/Open-ILS/xul/staff_client/server/cat/util.js +++ b/Open-ILS/xul/staff_client/server/cat/util.js @@ -50,7 +50,8 @@ cat.util.replace_barcode = function(old_bc) { '', $("catStrings").getString('staff.cat.util.replace_barcode.new_bc_window_prompt.title')); new_bc = String( new_bc ).replace(/\s/g,''); - if (!new_bc) { + /* Casting a possibly null input value to a String turns it into "null" */ + if (!new_bc || new_bc == 'null') { alert($("catStrings").getString('staff.cat.util.replace_barcode.new_bc.failed')); return old_bc; } -- 2.11.0