Bugzilla – Attachment 193833 Details for
Bug 41917
Parent itemtype fallback missing for bookable flag and circulation rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41917: (QA follow-up) Derive parent pool rule from child rule in TooMany
92e1a98.patch (text/plain), 3.06 KB, created by
Martin Renvoize (ashimema)
on 2026-02-25 07:32:10 UTC
(
hide
)
Description:
Bug 41917: (QA follow-up) Derive parent pool rule from child rule in TooMany
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2026-02-25 07:32:10 UTC
Size:
3.06 KB
patch
obsolete
>From 92e1a9823eae97ddc11a1b0a4a09f763741b777b Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >Date: Wed, 25 Feb 2026 06:29:28 +0000 >Subject: [PATCH] Bug 41917: (QA follow-up) Derive parent pool rule from child > rule in TooMany > >Now that CirculationRules::get_effective_rule performs parent itemtype >fallback internally, a child item with no specific maxissueqty rule >will already receive the parent rule back from that call. Deriving >$parent_maxissueqty_rule from $maxissueqty_rule in that case avoids >a redundant second get_effective_rule call for the parent itemtype. > >When the child does have its own specific rule the parent pool limit >is still fetched explicitly, preserving the existing behaviour for >that path. > >Also moves the $maxissueqty_rule lookup before the parent rule >determination so the result is available for the comparison. > >Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> >--- > C4/Circulation.pm | 37 +++++++++++++++++++++++++------------ > 1 file changed, 25 insertions(+), 12 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 9fa3c9e8745..a37a2c5a1ca 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -448,18 +448,6 @@ sub TooMany { > # given branch, patron category, and item type, determine > # applicable issuing rule > >- $parent_maxissueqty_rule = Koha::CirculationRules->get_effective_rule( >- { >- categorycode => $cat_borrower, >- itemtype => $parent_type, >- branchcode => $branch, >- rule_name => 'maxissueqty', >- } >- ) if $parent_type; >- >- # If the parent rule is for default type we discount it >- $parent_maxissueqty_rule = undef if $parent_maxissueqty_rule && !defined $parent_maxissueqty_rule->itemtype; >- > my $maxissueqty_rule = Koha::CirculationRules->get_effective_rule( > { > categorycode => $cat_borrower, >@@ -469,6 +457,31 @@ sub TooMany { > } > ); > >+ if ($parent_type) { >+ if ( $maxissueqty_rule >+ && defined $maxissueqty_rule->itemtype >+ && $maxissueqty_rule->itemtype eq $parent_type ) >+ { >+ # get_effective_rule already fell back to the parent itemtype rule >+ $parent_maxissueqty_rule = $maxissueqty_rule; >+ } else { >+ >+ # Child has its own specific rule; look up parent pool limit separately >+ $parent_maxissueqty_rule = Koha::CirculationRules->get_effective_rule( >+ { >+ categorycode => $cat_borrower, >+ itemtype => $parent_type, >+ branchcode => $branch, >+ rule_name => 'maxissueqty', >+ } >+ ); >+ >+ # Discard if only a global (non-itemtype-specific) rule was found >+ $parent_maxissueqty_rule = undef >+ if $parent_maxissueqty_rule && !defined $parent_maxissueqty_rule->itemtype; >+ } >+ } >+ > my $maxonsiteissueqty_rule = Koha::CirculationRules->get_effective_rule( > { > categorycode => $cat_borrower, >-- >2.53.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 41917
:
193776
|
193778
|
193779
|
193780
|
193799
|
193827
|
193828
|
193829
|
193830
|
193831
|
193832
| 193833 |
193834