Bug 38978 - [24.05.x] Can't hide column in holdings table from Table settings
Summary: [24.05.x] Can't hide column in holdings table from Table settings
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: 24.05
Hardware: All All
: P5 - low normal
Assignee: Lucas Gass (lukeg)
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-27 21:20 UTC by Lucas Gass (lukeg)
Modified: 2025-01-31 13:53 UTC (History)
7 users (show)

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


Attachments
Bug 38978: [24.05.x] Fix update_columns_visibility to check table settings (2.61 KB, patch)
2025-01-27 21:26 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 38978: [24.05.x] Don't show every column initially (1.42 KB, patch)
2025-01-28 01:15 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 38978: [24.05.x] Don't show every column initially (1.48 KB, patch)
2025-01-28 18:12 UTC, Imani
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-01-27 21:20:16 UTC
To recreate: 

1. In 24.05.x, hide some columns via Table settings.
2. The columns do not hide properly, you cannot hide any columns via Table settings on this table.
Comment 1 Lucas Gass (lukeg) 2025-01-27 21:21:01 UTC
It seems to be the update_columns_visibility function, it is hiding columns without data but ignoring those configured via column settings.
Comment 2 Lucas Gass (lukeg) 2025-01-27 21:26:17 UTC
Created attachment 177204 [details] [review]
Bug 38978: [24.05.x] Fix update_columns_visibility to check table settings

To test:
1. In 24.05.x, hide some columns via Table settings.
2. The columns do not hide properly, you cannot hide any columns via Table settings on this table.
3. APPLY PATCH
4. Check hiding columns now, it should work.
5. Make sure that columns with no data at all are still hidden.
6. Enable 'SeparateHoldings' and make sure you can also properly hide columns in the Other holdings table.
Comment 3 David Nind 2025-01-27 22:21:24 UTC
I had a go at testing, but the patch doesn't seem to work for me.

I can replicate the issue.

However, after applying the patch the columns are not hiding correctly for me.

Using KTD:
1. Koha codebase: git checkout 24.05.x
2. KTD:
   - Change .env file: KOHA_IMAGE=24.05
   - Update images: ktd pull
   - Start up KTD: ktd up
3. Apply the patch, restart everything (restart_all), and clear browser cache.
4. View record 262 (Programming Perl).
5. Default columns shown (holdings_issues, holdings_renewals, and holdings_localuse are selected in the "Is hidden by default" for table settings):
   - Tick box
   - Item type
   - Current library
   - Home library
   - Collection
   - Status
   - Last seen
   - Checkouts (is showing even though holdings_issues is hidden by default)
   - Renewals (is showing even though holdings_renewals is hidden by default)
   - Barcode
   - Actions column
6. Hide "Last seen" and "Barcode" (Table id: holdings_table).
7. Columns now shown:
   - Tick box
   - Item type
   - Current library
   - Home library
   - Collection
   - Status
   --> Last seen: still shown
   - Checkouts
   --> Renewals: no longer shown
   --> Barcode: still shown
   - Actions column
Comment 4 Lucas Gass (lukeg) 2025-01-28 01:02:48 UTC
Thanks David. I see, we don't have bKohaColumnsUseNames in main anymore but have it in 24.05.x, so this is accounting for missing columns. 

Reverting Bug 38118 solves the Table settings not working, but it brings back the bug describe there. 

Going to need a solution here that uses bKohaColumnsUseNames.
Comment 5 Lucas Gass (lukeg) 2025-01-28 01:15:39 UTC
Created attachment 177205 [details] [review]
Bug 38978: [24.05.x] Don't show every column initially

To test:
1. In 24.05.x, hide some columns via Table settings.
2. The columns do not hide properly, you cannot hide any columns via Table settings on this table.
3. APPLY PATCH
4. Check hiding columns now, it should work.
5. Make sure that columns with no data at all are still hidden.
6. Enable 'SeparateHoldings' and make sure you can also properly hide columns in the Other holdings table.
Comment 6 Lucas Gass (lukeg) 2025-01-28 01:16:41 UTC
Note to testers:

Ensure the test plans from Bug 38240 and Bug 38118 still work.
Comment 7 Imani 2025-01-28 16:24:39 UTC Comment hidden (obsolete)
Comment 8 Imani 2025-01-28 18:11:24 UTC Comment hidden (obsolete)
Comment 9 Imani 2025-01-28 18:12:15 UTC
Created attachment 177287 [details] [review]
Bug 38978: [24.05.x] Don't show every column initially

To test:
1. In 24.05.x, hide some columns via Table settings.
2. The columns do not hide properly, you cannot hide any columns via Table settings on this table.
3. APPLY PATCH
4. Check hiding columns now, it should work.
5. Make sure that columns with no data at all are still hidden.
6. Enable 'SeparateHoldings' and make sure you can also properly hide columns in the Other holdings table.

Signed-off-by: Imani Thomas <imani.thomas@bywatersolutions.com>
Comment 10 Jonathan Druart 2025-01-29 14:06:42 UTC
Fixing those bugs in version < 24.11 is almost impossible.

You can go with this, but you will have other weird behaviours that are certainly fixed in main.

For instance here, if you have a column A with (item1=aaa, item2=aaaa, item3=aaaaa), then a column B (with item1,2,3 empty and item 4=bbb)
Then global filter using aaa will remove the column B because all empty. If you clear the global filter the column B will stay empty.

This certainly also appears when you change page.

Example:
https://snipboard.io/PaXHmW.jpg
https://snipboard.io/lUVKHa.jpg
https://snipboard.io/MvDjUu.jpg

I am not blocking here, but I let you chose which bug is the worst :D
Comment 11 Lucas Gass (lukeg) 2025-01-30 18:07:43 UTC
(In reply to Jonathan Druart from comment #10)
> Fixing those bugs in version < 24.11 is almost impossible.

Why impossible?
Comment 12 Jonathan Druart 2025-01-31 13:53:35 UTC
(In reply to Lucas Gass (lukeg) from comment #11)
> (In reply to Jonathan Druart from comment #10)
> > Fixing those bugs in version < 24.11 is almost impossible.
> 
> Why impossible?

This area moved a lot, we there were several follow-ups to fix different bugs on this specific page.
As you can see in my previous comment your patch introduced another bug, which is fixed in the next version.