Browse Source

Bug 20529: Fix "Return to results" link broken by a double quote

(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 <severine.queune@bulac.fr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit e8c0215dfc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
20.11.x
Victor Grousset 6 years ago
committed by Fridolin Somers
parent
commit
39825a0dff
  1. 2
      koha-tmpl/intranet-tmpl/prog/js/browser.js

2
koha-tmpl/intranet-tmpl/prog/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) {

Loading…
Cancel
Save