From e19daa73f0f2fa5654257ca0c1fe637b0ac160b4 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 28 Oct 2024 15:50:01 +0100 Subject: [PATCH] Bug 33484: Do not redirect if loaded from state --- koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc | 3 ++- 1 file changed, 2 insertions(+), 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 f3a9af0f9cb..d2eef529c7c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc @@ -430,7 +430,8 @@ "dataSrc": function ( json ) { [% IF redirect_if_one_result %] // redirect if there is only 1 result. - if ( first_draw && json.recordsFiltered == 1 ) { + // Do not redirect if state has been loaded + if ( !loaded_from_state && first_draw && json.recordsFiltered == 1 ) { 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; -- 2.34.1