[open-ils-commits] r18907 - branches/rel_2_0/Open-ILS/web/opac/skin/default/js (miker)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Dec 3 10:09:20 EST 2010


Author: miker
Date: 2010-12-03 10:09:18 -0500 (Fri, 03 Dec 2010)
New Revision: 18907

Modified:
   branches/rel_2_0/Open-ILS/web/opac/skin/default/js/adv_global.js
Log:
Normalize spaces in notcontains advance search query terms to address bug https://bugs.launchpad.net/evergreen/+bug/677122

Modified: branches/rel_2_0/Open-ILS/web/opac/skin/default/js/adv_global.js
===================================================================
--- branches/rel_2_0/Open-ILS/web/opac/skin/default/js/adv_global.js	2010-12-03 00:18:30 UTC (rev 18906)
+++ branches/rel_2_0/Open-ILS/web/opac/skin/default/js/adv_global.js	2010-12-03 15:09:18 UTC (rev 18907)
@@ -294,7 +294,8 @@
 				break;
 
 			case 'nocontains' : {
-				var words = term.split(" ");
+	    			// Normalize spaces so we don't get "- " embedded in the query
+	    			var words = term.replace(/\s+/g,' ').replace(/^\s*/,'').replace(/\s*$/,'').split(" ");
 					for( var j in words ) 
 						string += " -" + words[j];
 				}



More information about the open-ils-commits mailing list