From c51968b603c7886430e0423354d418f5a2a03d55 Mon Sep 17 00:00:00 2001 From: Phil Ringnalda Date: Mon, 19 Jun 2023 18:32:46 -0700 Subject: [PATCH] Bug 28196: Insert searchid in URL correctly, so it doesn't follow the hash Test plan: 1. Search the catalog in the staff client for anything which will return at least two results 2. Click on any result to go to the bib detail page 3. Click the edit button for any item attached to the bib 4. Verify that the loaded URL contains &searchid=scs_(a number), and that the URL ends with #edititem 5. Make any change to the item, save, verify that your change was made Signed-off-by: Sam Lau Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 213392fd6bc02f3551a573e3a6127f3ecbaaed31) Signed-off-by: Martin Renvoize --- koha-tmpl/intranet-tmpl/prog/js/browser.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/browser.js b/koha-tmpl/intranet-tmpl/prog/js/browser.js index d5aae8b4e5..d51f78723a 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/browser.js +++ b/koha-tmpl/intranet-tmpl/prog/js/browser.js @@ -105,7 +105,9 @@ KOHA.browser = function (searchid, biblionumber) { }); $('a[href*="biblionumber="]').not('a[target="_blank"]').click(function (ev) { ev.preventDefault(); - window.location = $(this).attr('href') + '&searchid=' + me.searchid; + var url = new URL($(this).attr('href'), window.location.origin); + url.searchParams.set('searchid', me.searchid); + window.location = url.href; }); $('form[name="f"]').append(''); } -- 2.39.2