Bug 41280

Summary: Adjust PatronLibrary scope, respect global level for the second patron_maxissueqty rule in C4::Circulation::TooMany
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: CirculationAssignee: Marcel de Rooy <m.de.rooy>
Status: ASSIGNED --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: gmcharlt, kyle, martin.renvoize, nick
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27834
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41290
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
Bug 41280: Add patron library scope to PatronLibrary for branch level rules
Bug 41280: Add check on branchcode of patron_maxissueqty rule
Bug 41280: Add patron library scope to PatronLibrary for branch level rules
Bug 41280: Fix missing branchcode for patron qty rule

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.