Adobe-Consulting-Services / acs-aem-tools

http://adobe-consulting-services.github.io/acs-aem-tools/
120 stars 97 forks source link

Query Editor searching string with a space does not work #118

Closed mgaouar closed 8 years ago

mgaouar commented 9 years ago

When doing a query on a property and the value has a space the query editor only takes the first word of the search string, any word after the space is ignored.

To test:

I increased the logging level on QeueryBuilderImpl and you can see that property looks like this: property=property: value=Testing, property=name Whatever that is after the word Testing is ignored, only way to make it work is to replace the space by '%'

mgaouar commented 9 years ago

it looks like the problem is coming from this code : function params(source) { var o = {}; .each(source.split(/\s/), function(line) { line.replace(/([\w\W]?)=([\w\W]_)/, function($0, $1, $2) { o[$1] = $2; }); }); return o; }

in this file:

https://github.com/Adobe-Consulting-Services/acs-aem-tools/blob/master/content/src/main/content/jcr_root/apps/acs-tools/components/query-editor/clientlibs/js/controllers/controller-queryeditor.js

it's splitting lines with a space character.

mgaouar commented 9 years ago

I tried on my local instance and replaced the \s with \n in the split function and it works.

davidjgonzalez commented 8 years ago

Fixed via 9fdccbe1b3f8e902187e8415b1bf40ae25fe7da1

Thanks @bambara