From 687e7bbb8ea685b60703cd23f377d9c457151942 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Wed, 13 Mar 2024 11:23:13 +0000 Subject: [PATCH] Bug 36302: use replace instead of href This will change URL but not fiddle with browser history. Works the same (and as expected) in both Chrome and Firefox Test plan, ktd: 1) Search henry on the top search bar, notice 1 result is auto suggested 2) Ignore the auto-complete, press 'Enter' instead 3) Notice no results are returned. 4) Apply patch. Repeat. 5) Notice you get redirected to the single result of "henry" 6) Press the browser 'back' button and notice it works as expected (both Chrome+Firefox) 7) Visit patrons home directly: http://localhost:8081/cgi-bin/koha/members/members-home.pl 8) Notice no search is performed --- koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc index 0968619e833..e678b697920 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc @@ -393,7 +393,7 @@ let url = '[% redirect_url | url %]'.indexOf("?") != -1 ? '[% redirect_url | url %]&borrowernumber=' + json.data[0].patron_id : '[% redirect_url | url %]?borrowernumber=' + json.data[0].patron_id; - document.location.href = url; + window.location.replace(url); return false; } first_draw = 0; -- 2.30.2