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 2a34413601
  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 <david@davidnind.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2026-07-27 10:18:32 +02:00 committed by Lucas Gass
parent a987d4dfa7
commit bf55b2bc3b
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 2 additions and 4 deletions

View File

@ -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);
}