Bug 40321 - DataTables search ( dt-search ) does not work on holds history page
Summary: DataTables search ( dt-search ) does not work on holds history page
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Jonathan Druart
QA Contact: Brendan Lawlor
URL:
Keywords: rel_24_11_candidate, release-notes-needed
Depends on: 35560
Blocks:
  Show dependency treegraph
 
Reported: 2025-07-07 17:24 UTC by Lucas Gass (lukeg)
Modified: 2025-08-22 08:48 UTC (History)
8 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.11.00,25.05.03
Circulation function:


Attachments
Bug 40321: Fix hold history search (1.38 KB, patch)
2025-07-24 10:10 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 40321: Fix hold history search (1.43 KB, patch)
2025-07-24 17:51 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 40321: Fix hold history search (1.48 KB, patch)
2025-07-30 15:01 UTC, Brendan Lawlor
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass (lukeg) 2025-07-07 17:24:46 UTC
Using the DataTables native search ( dt-search ) doesn't seem to work on the holds history page.

To recreate:
1. Have a patron with holds history
2. Go to members/holdshistory.pl?borrowernumber=x where x is the borrowernumber 
3. Try to us the DT seacch to filter
4. Nothing gets filtered.
Comment 1 Lucas Gass (lukeg) 2025-07-22 17:36:02 UTC
Matt clued me in on what is happening here. It has to do with checkboxes for pending, waiting, processing, and in transit. 

"It's one big OR query which includes an array of all the possible statuses if the boxes are checked. So if you don’t touch those filters then it will always return all results." 

The checkboxes are going to take precedent in any search one does, and that feels right to me. 

You can also filter per individual column and that works as excepted. 

So in this case I think what we should do is change the dataTable config to NOT include the dt-search "search bar".
Comment 2 Jonathan Druart 2025-07-24 10:10:22 UTC
Created attachment 184583 [details] [review]
Bug 40321: Fix hold history search

The table global search didn't combine correctly with the status filters.

Test plan:
1. Have a patron with holds history
2. Go to members/holdshistory.pl?borrowernumber=x where x is the borrowernumber
3. Try to us the DT seacch to filter
=> Filtering is working as expected
Comment 3 Lucas Gass (lukeg) 2025-07-24 17:50:26 UTC
Trivial fix that makes a whole lot of sense, this is the behavior most people want.
Comment 4 Lucas Gass (lukeg) 2025-07-24 17:51:37 UTC
Created attachment 184600 [details] [review]
Bug 40321: Fix hold history search

The table global search didn't combine correctly with the status filters.

Test plan:
1. Have a patron with holds history
2. Go to members/holdshistory.pl?borrowernumber=x where x is the borrowernumber
3. Try to us the DT seacch to filter
=> Filtering is working as expected

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 5 Brendan Lawlor 2025-07-30 15:01:46 UTC
Created attachment 184898 [details] [review]
Bug 40321: Fix hold history search

The table global search didn't combine correctly with the status filters.

Test plan:
1. Have a patron with holds history
2. Go to members/holdshistory.pl?borrowernumber=x where x is the borrowernumber
3. Try to us the DT seacch to filter
=> Filtering is working as expected

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Comment 6 Brendan Lawlor 2025-07-30 15:10:37 UTC
The change from or to and makes sense and with the patch applied the status check boxes work together with the datatable search input as expected. Nice! Passing QA.
Comment 7 Lucas Gass (lukeg) 2025-07-31 18:46:40 UTC
Nice work everyone!

Pushed to main for 25.11
Comment 8 Kristi Krueger 2025-07-31 19:18:02 UTC
Happy to see this! Any chance for a backport?
Comment 9 Paul Derscheid 2025-08-22 08:29:21 UTC
Nice work everyone!

Pushed to 25.05.x