From cebd7351c856b273cc7938d772eb0c44d73b76cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 11 Dec 2014 22:30:20 +0100 Subject: [PATCH] Quote search text from widgets The text set as search_filter from a widget should be quoted to have the same behavior as the completion and also allow strict matching for text containing spaces. issue4388 review6711002 --- src/view.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/view.js b/src/view.js index 4b6bf514da..38c557e203 100644 --- a/src/view.js +++ b/src/view.js @@ -2315,6 +2315,7 @@ value, true); } }; + var parser = new Sao.common.DomainParser(); win = new Sao.Window.Search(model, callback.bind(this), { sel_multi: false, @@ -2324,7 +2325,7 @@ '').split(','), views_preload: (this.attributes.views || {}), new_: this.create_access(), - search_filter: text + search_filter: parser.quote(text) }); } }, @@ -2408,6 +2409,7 @@ this.entry.val(''); } }; + var parser = new Sao.common.DomainParser(); var win = new Sao.Window.Search(model, callback.bind(this), { sel_multi: false, @@ -2418,7 +2420,7 @@ views_preload: (this.attributes.views || {}), new_: this.create_access(), - search_filter: text + search_filter: parser.quote(text) }); } } @@ -3011,6 +3013,7 @@ } this.entry.val(''); }.bind(this); + var parser = new Sao.common.DomainParser(); var win = new Sao.Window.Search(this.attributes.relation, callback, { sel_multi: true, @@ -3020,7 +3023,7 @@ '').split(','), views_preload: this.attributes.views || {}, new_: this.attributes.create, - search_filter: text + search_filter: parser.quote(text) }); }, remove: function() {