https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43370

--- Comment #2 from Paul Derscheid <[email protected]> ---
Created attachment 204051
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=204051&action=edit
Bug 43370: Do not display an empty holdings column

The holdings table hides the columns that have no value on the current
page, but update_columns_visibility() applies the user's visibility
choices after that pass, so a column the user turned on is displayed,
empty, on the pages where it has none.

- Apply the user choices before the empty-column pass
- Keep the user choice untouched, only the display of the current page
  is affected

Test plan:
1. Have a record with more than 20 items, for instance:
     kj build 42 items with biblionumber=4
2. Give a call number to 20 of the items, and none to the others.
     UPDATE items SET itemcallnumber = NULL WHERE biblionumber = 4;
     UPDATE items SET itemcallnumber = CONCAT('CN-', itemnumber)
       WHERE biblionumber = 4 ORDER BY itemnumber LIMIT 20;
3. Go to /cgi-bin/koha/catalogue/detail.pl?biblionumber=4
4. Sort the table by "Call number", descending, so that every item
   with a call number is on the first page and the later pages have
   none. Do not rely on the default order.
5. In the column visibility menu, turn "Call number" off, then on
   again. Observe it is displayed on the first page.
6. Go to page 2. Observe the "Call number" column is displayed and
   empty for every row.
7. Apply the patch and reload the page.
8. Repeat steps 4 to 6. Observe the column is now hidden on page 2.
9. Go back to page 1. Observe the column is displayed again, so the
   user choice has been kept.

Assisted-by: Opus 5 (Anthropic)

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to