From bf55b2bc3b0a727629726c6852bf339ba571fd62 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 27 Jul 2026 10:18:32 +0200 Subject: [PATCH] Bug 43174: Restore defer loading for patron searches On the hold request and the patron search pages, the search is not deferred when a state exists. Coming from commit 2a344136014250b205ff74d8ea2dcb679ebb7105 Bug 41604: Save user decision per column when visibility changes - if (default_save_state_search) { + if (default_save_state || default_save_state_search) { $("#" + settings.nTable.id).data("loaded_from_state", true); - } else { + } + if (!default_save_state_search) { delete state.search; state.columns.forEach(c => delete c.search); I think this was a leftover from another try to fix bug 41604. I don't see how it could help in the context of saving the user decision. In the different patches from bug 41604 we don't test loaded_from_state. Test plan: Go to /cgi-bin/koha/members/members-home.pl => The table is not displayed Search for patrons => The table is displayed Reload the page => Without this patch the table is displayed => With this patch the table is not displayed If you have "Save search state on page change" enabled for this table, the table should be displayed if a previous search was made. Signed-off-by: David Nind Signed-off-by: Paul Derscheid Signed-off-by: Lucas Gass --- koha-tmpl/intranet-tmpl/prog/js/datatables.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js index 9492ec5e05..4208f5edeb 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js +++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js @@ -1290,11 +1290,9 @@ function _dt_save_restore_state(table_settings, external_filter_nodes = {}) { state = JSON.parse(state); - if (default_save_state || default_save_state_search) { + if (default_save_state_search) { $("#" + settings.nTable.id).data("loaded_from_state", true); - } - - if (!default_save_state_search) { + } else { delete state.search; state.columns.forEach(c => delete c.search); }