Bug 41280 - Adjust PatronLibrary scope, respect global level for the second patron_maxissueqty rule in C4::Circulation::TooMany
Summary: Adjust PatronLibrary scope, respect global level for the second patron_maxiss...
Status: ASSIGNED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Marcel de Rooy
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-11-21 09:42 UTC by Marcel de Rooy
Modified: 2025-11-24 13:12 UTC (History)
4 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:
Circulation function:


Attachments
Bug 41280: Add check on branchcode of patron_maxissueqty rule (1.56 KB, patch)
2025-11-21 10:09 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 41280: Add patron library scope to PatronLibrary for branch level rules (4.44 KB, patch)
2025-11-21 10:42 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 41280: Add check on branchcode of patron_maxissueqty rule (1.56 KB, patch)
2025-11-21 11:13 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 41280: Add patron library scope to PatronLibrary for branch level rules (4.45 KB, patch)
2025-11-21 11:13 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 41280: Fix missing branchcode for patron qty rule (7.33 KB, patch)
2025-11-24 13:09 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2025-11-21 09:42:19 UTC
See bug 27834. Thinking here about an alternative approach (without messing up the original report).
Comment 1 Marcel de Rooy 2025-11-21 10:09:19 UTC
Created attachment 189836 [details] [review]
Bug 41280: Add check on branchcode of patron_maxissueqty rule

Test plan:
Still coming
Comment 2 Marcel de Rooy 2025-11-21 10:42:29 UTC
Created attachment 189837 [details] [review]
Bug 41280: Add patron library scope to PatronLibrary for branch level rules

At the same time bringing both CircControl blocks more in sync by using
$branch and a new $prefetch variable.
Comment 3 Marcel de Rooy 2025-11-21 11:13:14 UTC
Created attachment 189838 [details] [review]
Bug 41280: Add check on branchcode of patron_maxissueqty rule

Test plan:
Still coming
Comment 4 Marcel de Rooy 2025-11-21 11:13:15 UTC
Created attachment 189839 [details] [review]
Bug 41280: Add patron library scope to PatronLibrary for branch level rules

At the same time bringing both CircControl blocks more in sync by using
$branch and a new $prefetch variable.
Comment 5 Marcel de Rooy 2025-11-21 11:13:36 UTC
Fixed: Can't call method "branchcode" on unblessed reference at /usr/share/koha/C4/Circulation.pm line 594
Comment 6 Marcel de Rooy 2025-11-24 13:09:48 UTC
Created attachment 189911 [details] [review]
Bug 41280: Fix missing branchcode for patron qty rule

Since we now want to check if the rule is global or not, we need more
than the rule value returned by GetBranchBorrowerCircRule.

This highlights another issue in this code (for a new report): the code
assumes that there is a regular issue rule on the same level (global or
branch) for regular issues when counting onsite issues. Theoretically,
this may not be the case. Added FIXMEs.
Comment 7 Marcel de Rooy 2025-11-24 13:12:08 UTC
Opened bug 41290 to have a closer look at circ scope for onsite checkouts. This feels wrong as it is now (too much assumptions).
Comment 8 Marcel de Rooy 2025-11-24 13:12:42 UTC
Before getting further here, I need feedback.
After that we can fix tests etc.