From 309e32013155c65b35b5ad296ad8cb7aec09d3a8 Mon Sep 17 00:00:00 2001 From: miker Date: Thu, 2 Dec 2010 19:32:30 +0000 Subject: [PATCH] Normalize spaces in notcontains advance search query terms to address bug https://bugs.launchpad.net/evergreen/+bug/677122 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Open-ILS/web/opac/skin/default/js/adv_global.js b/Open-ILS/web/opac/skin/default/js/adv_global.js index 9fdfca3a11..5cacdda71e 100644 --- a/Open-ILS/web/opac/skin/default/js/adv_global.js +++ b/Open-ILS/web/opac/skin/default/js/adv_global.js @@ -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]; } -- 2.11.0