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

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


Author: miker
Date: 2010-12-03 10:10:00 -0500 (Fri, 03 Dec 2010)
New Revision: 18908

Modified:
   branches/rel_1_6/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_1_6/Open-ILS/web/opac/skin/default/js/adv_global.js
===================================================================
--- branches/rel_1_6/Open-ILS/web/opac/skin/default/js/adv_global.js	2010-12-03 15:09:18 UTC (rev 18907)
+++ branches/rel_1_6/Open-ILS/web/opac/skin/default/js/adv_global.js	2010-12-03 15:10:00 UTC (rev 18908)
@@ -293,7 +293,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