From 3283b66f0513f2ffbfabba0cf2c4f179096e80ee Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 8 Oct 2024 10:52:23 +0200 Subject: [PATCH] Bug 33484: Fix patron search form Reset DT's filters if we are searching again using the search form. If you use the form on the left we need to reset the different filters that could have been set from a previous state we loaded. Signed-off-by: Pedro Amorim Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize --- 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 f53918f5f86..e8586ac45b1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc @@ -871,6 +871,7 @@ let table_dt = patrons_table.DataTable(); let loaded_from_state = table_dt.settings()[0].loaded_from_state; if ( !loaded_from_state ) { + table_dt.search("").columns().search(""); [% FOR c IN columns %] [% SWITCH c %] [% CASE 'branch' %] @@ -883,8 +884,8 @@ table_dt.column([% loop.count - 1 %]).search(category_id ? '^'+category_id+'$' : ''); [% END %] [% END %] - table_dt.search(""); } + table_dt.settings()[0].loaded_from_state = false; first_draw = 1; // Only redirect if we are coming from here table_dt.draw(); [% IF display_search_description %] -- 2.34.1