From 109a1e93dc90bdc77dff55827f7d326d29cbae0f Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 22 Mar 2024 12:47:22 +0000 Subject: [PATCH] Bug 35648: (follow-up) Clear table filter before submitting This patch takes advise from elasticsearch-mappings.js and adds an onsubmit event to clear any DataTables filter before submitting. This should prevent hidden fields from being overwritten. To test, filter the table and make a change to one of the visible rows. After submitting, confirm that the previously-hidden rows retain the same settings as before. Signed-off-by: Kyle M Hall Signed-off-by: Katrin Fischer --- .../intranet-tmpl/prog/en/modules/tools/overduerules.tt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/overduerules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/overduerules.tt index 3cfd0939f7..7b9e57f862 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/overduerules.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/overduerules.tt @@ -67,7 +67,7 @@ [% END %] [% IF ( table ) %] -
+ [% INCLUDE 'csrf-token.inc' %] @@ -198,6 +198,12 @@ "dom": '<"top pager"f>rt<"clear">', "paginate": false, })); + + $("#overduerulesf").on("submit", function(e){ + $(".overduerulest").DataTable().search('').draw(); + return true; + }); + }); [% END %] -- 2.39.5