Normalize spaces in notcontains advance search query terms to address bug https:...
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 3 Dec 2010 15:11:02 +0000 (15:11 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 3 Dec 2010 15:11:02 +0000 (15:11 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_6_1@18909 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index 74edd3f..f77f1b4 100644 (file)
@@ -293,7 +293,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];
                                }