Normalize spaces in notcontains advance search query terms to address bug https:...
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 2 Dec 2010 19:32:30 +0000 (19:32 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 2 Dec 2010 19:32:30 +0000 (19:32 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@18901 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/skin/default/js/adv_global.js

index 9fdfca3..5cacdda 100644 (file)
@@ -294,7 +294,8 @@ function advBuildSearchBlob() {
                                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];
                                }