From 09c182ec54a09c92aeef6a258c0cc6566c27f2a5 Mon Sep 17 00:00:00 2001 From: Victor Grousset Date: Mon, 16 Apr 2018 18:55:48 +0200 Subject: [PATCH] Bug 20529: Fix "Return to results" link broken by a double quote MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (in the search query) cause: decodeURIComponent used when URI encoding was necessary. (At least in main usecase of this feature) It could have been a copy and paste error. From the above browseRecords() function. == Test plan == 1. Search in the staff catalogue «a "alice"» Replace a and alice with whatever than will return a result for you 2. Click on the first result 3. Check the "Return to results" link It should be like staff_url://cgi-bin/koha/catalogue/search.pl?idx=kw&q=a This is the bug. Because when clicking the link, your search will be 'kw,wrdl: a' instead of 'kw,wrdl: a "alice"' 4. Apply this patch. 5. Search in the staff catalogue «a "alice"» Replace a and alice with whatever than will return a result for you 6. Click on the first result 7. Check the "Return to results" link The link should preserve the full query Signed-off-by: Séverine QUEUNE Signed-off-by: Séverine QUEUNE Signed-off-by: Nick Clemens --- koha-tmpl/intranet-tmpl/js/browser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/js/browser.js b/koha-tmpl/intranet-tmpl/js/browser.js index 19d707376e..09a4da26d7 100644 --- a/koha-tmpl/intranet-tmpl/js/browser.js +++ b/koha-tmpl/intranet-tmpl/js/browser.js @@ -81,7 +81,7 @@ KOHA.browser = function (searchid, biblionumber) { $(document).ready(function () { if (me.curPos > -1) { - var searchURL = '/cgi-bin/koha/catalogue/search.pl?' + decodeURIComponent(current_search.query) + '&limit=' + decodeURIComponent(current_search.limit) + '&sort_by=' + current_search.sort + '&searchid=' + me.searchid + '&offset=' + me.offset; + var searchURL = '/cgi-bin/koha/catalogue/search.pl?' + current_search.query + '&limit=' + decodeURIComponent(current_search.limit) + '&sort_by=' + current_search.sort + '&searchid=' + me.searchid + '&offset=' + me.offset; var prevbutton; var nextbutton; if (me.curPos === 0 && parseInt(current_search.offset) === 1) { -- 2.31.1