Bug 41457 - Hold history table does not deal with column visibility correctly
Summary: Hold history table does not deal with column visibility correctly
Status: Passed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal
Assignee: Jonathan Druart
QA Contact: Kyle M Hall (khall)
URL:
Keywords:
Depends on: 41456
Blocks:
  Show dependency treegraph
 
Reported: 2025-12-16 12:32 UTC by Jonathan Druart
Modified: 2026-01-30 19:41 UTC (History)
4 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 41457: Fix column visibility on the holds history table (8.34 KB, patch)
2025-12-16 12:45 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 41457: Fix column visibility on the holds history table (8.34 KB, patch)
2025-12-18 08:59 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 41457: Fix column visibility on the holds history table (8.39 KB, patch)
2025-12-22 03:34 UTC, David Nind
Details | Diff | Splinter Review
Bug 41457: Add missing html filter (1.01 KB, patch)
2025-12-23 15:09 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 41457: Fix column visibility on the holds history table (8.46 KB, patch)
2026-01-30 19:41 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 41457: Add missing html filter (1.08 KB, patch)
2026-01-30 19:41 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2025-12-16 12:32:11 UTC
The "Item type" column is displayed/hidden depending on the syspref AllowHoldItemTypeSelection.

If DT's state is saved and the pref modified, the state will be lost.

We MUST use bKohaColumnsUseNames (columns' name) to make it work correctly.
Comment 1 Jonathan Druart 2025-12-16 12:45:37 UTC
Created attachment 190538 [details] [review]
Bug 41457: Fix column visibility on the holds history table

We must use bKohaColumnsUseNames to correctly deal with the column
visibility if some columns are shown/hidden depending on sysprefs.

On the holds history table we have "item type" that is hidden if
AllowHoldItemTypeSelection is disabled.

Test plan:
1. Create a hold and select an item type
Note: I think there is a bug if you select it from "Hold next available
item", use "Hold details". Please confirm?
2. Go to the holds history view
3. Hide some columns
4. Modify the value of AllowHoldItemTypeSelection
5. Reload the page and notice that the state of the table is restored
   correctly, however the "item type" column is shown or hidden
   depending on the syspref's value.
Comment 2 David Nind 2025-12-16 16:49:38 UTC
This seems to work correctly for me, however no value is shown in the rows for the "Requested item type" column. (Selecting from the dropdown list or using the filters works as expected/)

For step 1, if I select "Request specific item type" (Books):

- from under the "Hold next available item" section, it shows in the patron's holds history as "Any item type" (doesn't matter what I select here)

- from under "Hold details" section, it shows in the patron's holds history as "Book"
Comment 3 Jonathan Druart 2025-12-18 08:59:06 UTC
Created attachment 190612 [details] [review]
Bug 41457: Fix column visibility on the holds history table

We must use bKohaColumnsUseNames to correctly deal with the column
visibility if some columns are shown/hidden depending on sysprefs.

On the holds history table we have "item type" that is hidden if
AllowHoldItemTypeSelection is disabled.

Test plan:
1. Create a hold and select an item type
Note: I think there is a bug if you select it from "Hold next available
item", use "Hold details". Please confirm?
2. Go to the holds history view
3. Hide some columns
4. Modify the value of AllowHoldItemTypeSelection
5. Reload the page and notice that the state of the table is restored
   correctly, however the "item type" column is shown or hidden
   depending on the syspref's value.
Comment 4 Jonathan Druart 2025-12-18 08:59:35 UTC
(In reply to David Nind from comment #2)
> This seems to work correctly for me, however no value is shown in the rows
> for the "Requested item type" column. (Selecting from the dropdown list or
> using the filters works as expected/)

Oops yes, last minute change, again!
Comment 5 David Nind 2025-12-22 03:34:55 UTC
Created attachment 190656 [details] [review]
Bug 41457: Fix column visibility on the holds history table

We must use bKohaColumnsUseNames to correctly deal with the column
visibility if some columns are shown/hidden depending on sysprefs.

On the holds history table we have "item type" that is hidden if
AllowHoldItemTypeSelection is disabled.

Test plan:
1. Create a hold and select an item type
Note: I think there is a bug if you select it from "Hold next available
item", use "Hold details". Please confirm?
2. Go to the holds history view
3. Hide some columns
4. Modify the value of AllowHoldItemTypeSelection
5. Reload the page and notice that the state of the table is restored
   correctly, however the "item type" column is shown or hidden
   depending on the syspref's value.

Signed-off-by: David Nind <david@davidnind.com>
Comment 6 David Nind 2025-12-22 03:41:21 UTC
I've signed off, and I think it is working correctly.

However:

1. If I apply the patch and set AllowHoldItemTypeSelection = Allow.

2. If I try and hide the "Requested item type" column either by using the table configuration settings or the columns option, it works for that one time.

3. When I go to another page, and then go back to the patron's holds history page, it is then shown again.

4. I'm assuming this is to do with either of the "Save configuration state on page change" and "Save search state on page change" configuration settings, but I've never spent any time trying to figure out what they mean.

5. If I set AllowHoldItemTypeSelection = Don't allow, the column "Requested item type" is not shown in either the columns dropdown list, and whatever is set with the table configuration does not have any effect.
Comment 7 David Nind 2025-12-22 03:42:18 UTC
(In reply to Jonathan Druart from comment #4)
> (In reply to David Nind from comment #2)
> > This seems to work correctly for me, however no value is shown in the rows
> > for the "Requested item type" column. (Selecting from the dropdown list or
> > using the filters works as expected/)
> 
> Oops yes, last minute change, again!

A value is now shown in the "Requested item type" column.
Comment 8 Martin Renvoize (ashimema) 2025-12-23 14:39:43 UTC
QA script complains:

missing_filter at line 178 (        const show_itemtype_column = [% Koha.Preference('AllowHoldItemTypeSelection') ? 1 : 0 %];)
Comment 9 Jonathan Druart 2025-12-23 15:09:24 UTC
Created attachment 190704 [details] [review]
Bug 41457: Add missing html filter

Patch from commit c750270
Comment 10 Kyle M Hall (khall) 2026-01-30 19:41:55 UTC
Created attachment 192276 [details] [review]
Bug 41457: Fix column visibility on the holds history table

We must use bKohaColumnsUseNames to correctly deal with the column
visibility if some columns are shown/hidden depending on sysprefs.

On the holds history table we have "item type" that is hidden if
AllowHoldItemTypeSelection is disabled.

Test plan:
1. Create a hold and select an item type
Note: I think there is a bug if you select it from "Hold next available
item", use "Hold details". Please confirm?
2. Go to the holds history view
3. Hide some columns
4. Modify the value of AllowHoldItemTypeSelection
5. Reload the page and notice that the state of the table is restored
   correctly, however the "item type" column is shown or hidden
   depending on the syspref's value.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 11 Kyle M Hall (khall) 2026-01-30 19:41:57 UTC
Created attachment 192277 [details] [review]
Bug 41457: Add missing html filter

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>