[open-ils-commits] r12586 - in trunk/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 17:41:11 EDT 2009
Author: dbs
Date: 2009-03-18 17:41:06 -0400 (Wed, 18 Mar 2009)
New Revision: 12586
Modified:
trunk/Open-ILS/xul/staff_client/chrome/content/main/menu.js
trunk/Open-ILS/xul/staff_client/server/cat/util.js
Log:
Casting a null into a String results in a string with a value of "null"; change test accordingly
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/main/menu.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/main/menu.js 2009-03-18 19:46:52 UTC (rev 12585)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/main/menu.js 2009-03-18 21:41:06 UTC (rev 12586)
@@ -160,7 +160,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: trunk/Open-ILS/xul/staff_client/server/cat/util.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/util.js 2009-03-18 19:46:52 UTC (rev 12585)
+++ trunk/Open-ILS/xul/staff_client/server/cat/util.js 2009-03-18 21:41:06 UTC (rev 12586)
@@ -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