Bug 39423

Summary: Column checkboxes on item batch modification hide incorrect columns
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: ToolsAssignee: Fridolin Somers <fridolin.somers>
Status: Pushed to main --- QA Contact: Marcel de Rooy <m.de.rooy>
Severity: normal    
Priority: P5 - low CC: acampbell, emmi.takkinen, fridolin.somers, m.de.rooy, trevor.diamond
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22926
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
Circulation function:
Bug Depends on: 32477, 35402    
Bug Blocks:    
Attachments: Bug 39423: Fix column checkboxes in batch item modification hide incorrect columns
Bug 39423: Fix column checkboxes in batch item modification hide incorrect columns
Bug 39423: Fix column checkboxes in batch item modification hide incorrect columns

Description Nick Clemens (kidclamp) 2025-03-22 17:00:32 UTC
It looks like the 'Hold' column is not taken into account in the numbering, unchecking any column removes the next column over
Comment 1 Emmi Takkinen 2025-03-24 06:32:08 UTC
I think that instead of fixing this (again) we should focus in adding Datatable column configuration to both batch item modification and batch item delete pages as suggested in bug 22926.
Comment 2 trevor.diamond 2025-07-14 12:52:05 UTC
I support a fix that prevents this from happening again (as mentioned by Emmi on 2025-03-24) but regardless of which fix is applied, it would be nice if this did get fixed one way or another.
Comment 3 Fridolin Somers 2025-08-06 08:13:34 UTC
I think I found a good fix
Comment 4 Fridolin Somers 2025-08-06 08:28:58 UTC
Created attachment 185136 [details] [review]
Bug 39423: Fix column checkboxes in batch item modification hide incorrect columns

In batch item modification, unchecking any column hides the previous column.

This is caused by new HTML in table header :
<span class="dt-column-title"></span><span class="dt-column-order"></span>

This patch fixed by adding ".dt-column-title" to function guess_nb_cols().

Test plan :
1) Go to batch item modification
2) In "Show/hide columns:" click on "Home library" column
=> Check correct column is hidden
3) Go to another batch item modification
=> Check column "Home library" is hidden (from cookie storage)
Comment 5 Emmi Takkinen 2025-08-06 10:34:59 UTC
Created attachment 185149 [details] [review]
Bug 39423: Fix column checkboxes in batch item modification hide incorrect columns

In batch item modification, unchecking any column hides the previous column.

This is caused by new HTML in table header :
<span class="dt-column-title"></span><span class="dt-column-order"></span>

This patch fixed by adding ".dt-column-title" to function guess_nb_cols().

Test plan :
1) Go to batch item modification
2) In "Show/hide columns:" click on "Home library" column
=> Check correct column is hidden
3) Go to another batch item modification
=> Check column "Home library" is hidden (from cookie storage)

Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Comment 6 Marcel de Rooy 2025-08-08 09:31:08 UTC
Created attachment 185264 [details] [review]
Bug 39423: Fix column checkboxes in batch item modification hide incorrect columns

In batch item modification, unchecking any column hides the previous column.

This is caused by new HTML in table header :
<span class="dt-column-title"></span><span class="dt-column-order"></span>

This patch fixed by adding ".dt-column-title" to function guess_nb_cols().

Test plan :
1) Go to batch item modification
2) In "Show/hide columns:" click on "Home library" column
=> Check correct column is hidden
3) Go to another batch item modification
=> Check column "Home library" is hidden (from cookie storage)

Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 7 Lucas Gass (lukeg) 2025-08-13 19:41:30 UTC
Nice work everyone!

Pushed to main for 25.11