Bug 40988 - Subfunds in acqui-home.pl and aqbudgets.pl are not collapsible beyond 20th line
Summary: Subfunds in acqui-home.pl and aqbudgets.pl are not collapsible beyond 20th line
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Jonathan Druart
QA Contact: Andrew Fuerste-Henry
URL:
Keywords: rel_25_05_candidate
Depends on:
Blocks:
 
Reported: 2025-10-09 18:11 UTC by Andrew Fuerste-Henry
Modified: 2025-11-03 13:42 UTC (History)
5 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:
25.11.00
Circulation function:


Attachments
Bug 40988: Remove pagination for funds on acqui home (1.76 KB, patch)
2025-10-21 08:39 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 40988: Remove pagination for funds on acqui home (1.81 KB, patch)
2025-10-29 18:54 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 40988: Remove pagination for funds on acqui home (1.88 KB, patch)
2025-10-29 18:56 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Fuerste-Henry 2025-10-09 18:11:58 UTC
When Koha renders the table of funds and subfunds for the acq homepage and the funds page in Administration, it inserts a little triangle button next to each parent fund that can be used to collapse the associated sub-funds. However, it only inserts these little buttons for parent funds within the first 20 funds returned. Beyond the 20th fund, all funds & subfunds and listed correctly but the triangle button isn't offered and subfunds cannot be collapsed.

This page defaults to 20 entries per page and it looks like we're only inserting collapse buttons for what's shown at page load. If one adjusts the table to show only 10 entries, the 11th-20th parent funds will still show their collapse button successfully, but changing the number of entries to show doesn't reload the page.

To recreate:
- Have 20 funds, no subfunds
- Add a subfund to the first fund in your list
- see that the parent fund has a little triangle you can use to collapse its subfund
- note that this has pushed the last fund in your list onto a second page
- add a subfund to the last fund in your list
- confirm this parent fund on does *not* get a little triangle button and you cannot collapse it
Comment 1 Jonathan Druart 2025-10-21 08:39:04 UTC
Created attachment 188199 [details] [review]
Bug 40988: Remove pagination for funds on acqui home

As well as the fund list view (admin/aqbudgets.pl)
Comment 2 Jonathan Druart 2025-10-21 08:39:26 UTC
I've tried many things to fix this problem, even using another tree table plugin (https://github.com/reside-ic/TreeTables - which works great btw). But finally noticed that we might now want the pagination at all? Can you confirm?

If we remove pagination then the expand/collapse icons work for all budgets/funds.
Comment 3 Andrew Fuerste-Henry 2025-10-21 18:19:26 UTC
(In reply to Jonathan Druart from comment #2)
> I've tried many things to fix this problem, even using another tree table
> plugin (https://github.com/reside-ic/TreeTables - which works great btw).
> But finally noticed that we might now want the pagination at all? Can you
> confirm?
> 
> If we remove pagination then the expand/collapse icons work for all
> budgets/funds.

Removing pagination would be great for libraries with a moderate number of funds, but would result in slow pages loads for libraries with a lot of funds and orders. Our preferred course here would be to get collapse/expand functionality working across paginated funds and then file a new bug to get this table to allow configuration of how many rows to show by default.
Comment 4 Jonathan Druart 2025-10-22 06:02:26 UTC
It's currently paginate client-side, this patch shouldn't impact performance significantly.
Comment 5 Andrew Fuerste-Henry 2025-10-29 18:54:57 UTC
Created attachment 188592 [details] [review]
Bug 40988: Remove pagination for funds on acqui home

As well as the fund list view (admin/aqbudgets.pl)

Signed-off-by: Sarah Berry <sberry@pascolibraries.org>
Comment 6 Andrew Fuerste-Henry 2025-10-29 18:56:18 UTC
Created attachment 188593 [details] [review]
Bug 40988: Remove pagination for funds on acqui home

As well as the fund list view (admin/aqbudgets.pl)

Signed-off-by: Sarah Berry <sberry@pascolibraries.org>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Comment 7 Lucas Gass (lukeg) 2025-10-31 21:30:24 UTC
Nice work everyone!

Pushed to main for 25.11