[open-ils-commits] r12590 - in branches/rel_1_4/Open-ILS/xul/staff_client: chrome/content/main server/cat (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Mar 18 21:49:27 EDT 2009


Author: dbs
Date: 2009-03-18 21:49:26 -0400 (Wed, 18 Mar 2009)
New Revision: 12590

Modified:
   branches/rel_1_4/Open-ILS/xul/staff_client/chrome/content/main/menu.js
   branches/rel_1_4/Open-ILS/xul/staff_client/server/cat/util.js
Log:
Backport r12586 from trunk to prevent 'Replace Barcode' from trying to set a barcode to 'null' on Cancel

Modified: branches/rel_1_4/Open-ILS/xul/staff_client/chrome/content/main/menu.js
===================================================================
--- branches/rel_1_4/Open-ILS/xul/staff_client/chrome/content/main/menu.js	2009-03-19 00:51:10 UTC (rev 12589)
+++ branches/rel_1_4/Open-ILS/xul/staff_client/chrome/content/main/menu.js	2009-03-19 01:49:26 UTC (rev 12590)
@@ -130,7 +130,8 @@
 	
 						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;
 						}

Modified: branches/rel_1_4/Open-ILS/xul/staff_client/server/cat/util.js
===================================================================
--- branches/rel_1_4/Open-ILS/xul/staff_client/server/cat/util.js	2009-03-19 00:51:10 UTC (rev 12589)
+++ branches/rel_1_4/Open-ILS/xul/staff_client/server/cat/util.js	2009-03-19 01:49:26 UTC (rev 12590)
@@ -50,7 +50,8 @@
 			'',
 			$("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;
 		}



More information about the open-ils-commits mailing list