Bugzilla – Attachment 189991 Details for
Bug 8137
Checkout limit for all libraries
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8137: (follow-up) Correction of the rule return if no priority rule is defined
Bug-8137-follow-up-Correction-of-the-rule-return-i.patch (text/plain), 2.01 KB, created by
Thibaud Guillot (thibaud_g)
on 2025-11-27 13:44:57 UTC
(
hide
)
Description:
Bug 8137: (follow-up) Correction of the rule return if no priority rule is defined
Filename:
MIME Type:
Creator:
Thibaud Guillot (thibaud_g)
Created:
2025-11-27 13:44:57 UTC
Size:
2.01 KB
patch
obsolete
>From ac67a91e022756b73df6f11d37764586ca0555e9 Mon Sep 17 00:00:00 2001 >From: Thibaud Guillot <thibaud.guillot@biblibre.com> >Date: Thu, 27 Nov 2025 13:42:41 +0000 >Subject: [PATCH] Bug 8137: (follow-up) Correction of the rule return if no > priority rule is defined > >--- > Koha/CirculationRules.pm | 16 +++++++--------- > 1 file changed, 7 insertions(+), 9 deletions(-) > >diff --git a/Koha/CirculationRules.pm b/Koha/CirculationRules.pm >index 3308d27070..7b702f05ff 100644 >--- a/Koha/CirculationRules.pm >+++ b/Koha/CirculationRules.pm >@@ -230,6 +230,7 @@ our $RULE_KINDS = { > has_priority => { > scope => [ 'branchcode', 'categorycode' ], > }, >+ > # Not included (deprecated?): > # * accountsent > # * reservecharge >@@ -299,19 +300,16 @@ sub get_effective_rule { > $search_params, > { > order_by => $order_by, >- rows => 1, >+ rows => 1, > } > )->single; > > if ( grep { $_ eq $rule_name } ( 'maxissueqty', 'maxonsiteissueqty' ) ) { > if ( defined $priority_rule ) { >- if ( $priority_rule->rule_value > $rule->rule_value ) { >- return $rule; >- } >- return $priority_rule; >+ return ( $priority_rule->rule_value > $rule->rule_value ) ? $rule : $priority_rule; > } >- } >- else { >+ return $rule; >+ } else { > return defined $priority_rule ? $priority_rule : $rule; > } > } >@@ -344,8 +342,8 @@ sub get_effective_rule_value { > my $has_priority = $params->{has_priority}; > > my $memory_cache = Koha::Cache::Memory::Lite->get_instance; >- my $cache_key = sprintf "CircRules:%s:%s:%s:%s:%s", $rule_name // q{}, >- $categorycode // q{}, $branchcode // q{}, $itemtype // q{} ,$has_priority // q{}; >+ my $cache_key = sprintf "CircRules:%s:%s:%s:%s:%s", $rule_name // q{}, >+ $categorycode // q{}, $branchcode // q{}, $itemtype // q{}, $has_priority // q{}; > > my $cached = $memory_cache->get_from_cache($cache_key); > return $cached if $cached; >-- >2.39.5
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 8137
:
9705
|
9706
|
11079
|
64703
|
64704
|
64791
|
64891
|
72831
|
72832
|
107207
|
107208
|
107209
|
107459
|
111368
|
111369
|
111370
|
112640
|
113797
|
113882
|
114531
|
114532
|
114533
|
114534
|
116676
|
116677
|
116678
|
116679
|
116680
|
145476
|
145477
|
145478
|
145479
|
145480
|
152040
|
152041
|
152042
|
152043
|
152044
|
152045
|
156316
|
156317
|
156318
|
156319
|
156320
|
156321
|
156322
|
159712
|
162367
|
167208
|
167923
|
168119
|
169084
|
169696
|
169700
|
169727
|
169927
|
169928
|
170411
|
173605
|
173608
|
175837
|
175838
|
177464
|
186028
|
186029
|
186030
|
188548
|
188623
|
189989
|
189990
| 189991