Bug 40321

Summary: DataTables search ( dt-search ) does not work on holds history page
Product: Koha Reporter: Lucas Gass (lukeg) <lucas>
Component: PatronsAssignee: Jonathan Druart <jonathan.druart>
Status: Signed Off --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: gmcharlt, jonathan.druart, kkrueger, kyle, lisette
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 35560    
Bug Blocks:    
Attachments: Bug 40321: Fix hold history search
Bug 40321: Fix hold history search

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>