From f4f231f1032978e81deb0af0d7c4ad2ecd49b70d Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 24 Oct 2024 10:44:40 +0200 Subject: [PATCH] Bug 33484: Do not consider we loaded from state if search was not saved The loaded_from_state flag is used to know if we defer the loading of the table or not. We should not display the result (ie not defer loading) if only the configuration has been retrieved from localStorage. Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer --- .../intranet-tmpl/prog/en/includes/columns_settings.inc | 5 +++-- koha-tmpl/intranet-tmpl/prog/js/datatables.js | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc index 30146653da..46411008b0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc @@ -54,11 +54,12 @@ function KohaTable(id_selector, dt_parameters, table_settings, add_filters) { state = JSON.parse(state); - if (!default_save_state_search ) { + if (default_save_state_search ) { + settings.loaded_from_state = true; + } else { delete state.search; state.columns.forEach(c => delete c.search ); } - settings.loaded_from_state = true; return state; } diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js index 3388b187d3..257eb8b1c7 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js +++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js @@ -999,11 +999,12 @@ function _dt_save_restore_state(table_settings, external_filter_nodes={}){ state = JSON.parse(state); - if (!default_save_state_search ) { + if (default_save_state_search ) { + settings.loaded_from_state = true; + } else { delete state.search; state.columns.forEach(c => delete c.search ); } - settings.loaded_from_state = true; return state; } -- 2.39.5