Bug 41624 - Improvements to Bug 35211
Summary: Improvements to Bug 35211
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on: 35211
Blocks:
  Show dependency treegraph
 
Reported: 2026-01-14 21:46 UTC by Lucas Gass (lukeg)
Modified: 2026-01-14 21:51 UTC (History)
1 user (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 41624: Improve how branchcodes are handled (3.20 KB, patch)
2026-01-14 21:51 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 41624: Move other_holdings_count outside of loop so it is only calculated once (1.08 KB, patch)
2026-01-14 21:51 UTC, Lucas Gass (lukeg)
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) 2026-01-14 21:46:59 UTC
Bug 35211 has some problems. 

1. This is hard to read/maintain:

        const branchcodes = { 
          [% FOREACH key IN branchcodes.keys %]
            "[% key | html %]": [
              [% FOREACH code IN branchcodes.$key %]
                "[% code | html %]"[% UNLESS loop.last %], [% END %]
              [% END %]
            ][% UNLESS loop.last %], [% END %]
          [% END %]
        };


2. If you select Show/Hide filters on the group holdings table the table disappears. 

3. other_holdings_count is counted over and over inside the loop, it isn't necessary to do so. 

4. The code seems to unnecessarily touch colvis settings
Comment 1 Lucas Gass (lukeg) 2026-01-14 21:51:25 UTC
Created attachment 191470 [details] [review]
Bug 41624: Improve how branchcodes are handled

-This patch is an attempt to improve how we retrive branchcodes. Too much of this logic is unnesseary done in the template.
-This also removed the unneeded "use Koha::Library::Group;"
Comment 2 Lucas Gass (lukeg) 2026-01-14 21:51:32 UTC
Created attachment 191471 [details] [review]
Bug 41624: Move other_holdings_count outside of loop so it is only calculated once