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 <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 213392fd6b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit c51968b603)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
This commit is contained in:
Phil Ringnalda 2023-06-19 18:32:46 -07:00 committed by Matt Blenkinsop
parent de70df82a7
commit a5dbc98bd3
1 changed files with 3 additions and 1 deletions

View File

@ -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('<input type="hidden" name="searchid" value="' + me.searchid + '"></input>');
}