Bugzilla – Attachment 151160 Details for
Bug 32129
Use patron categorycode of most relevant recall when checking if item can be a waiting recall
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32129: (QA follow-up) Avoid duplicate calculation
Bug-32129-QA-follow-up-Avoid-duplicate-calculation.patch (text/plain), 1.54 KB, created by
Tomás Cohen Arazi
on 2023-05-12 20:12:38 UTC
(
hide
)
Description:
Bug 32129: (QA follow-up) Avoid duplicate calculation
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi
Created:
2023-05-12 20:12:38 UTC
Size:
1.54 KB
patch
obsolete
>From 1fd02ceb24949da2efdb7f1d083e374ada4af668 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 12 May 2023 15:47:02 -0300 >Subject: [PATCH] Bug 32129: (QA follow-up) Avoid duplicate calculation > >This patch stores the output from ->check_recall() (a Koha::Recall >object or undef) and reuses afterwards, on a ternaty operator. >--- > Koha/Item.pm | 17 +++++++++-------- > 1 file changed, 9 insertions(+), 8 deletions(-) > >diff --git a/Koha/Item.pm b/Koha/Item.pm >index 849f436a5aa..ea2677a01ff 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -1975,14 +1975,15 @@ sub can_be_waiting_recall { > } > > # Check the circulation rule for each relevant itemtype for this item >- my $rule = Koha::CirculationRules->get_effective_rules({ >- branchcode => $branchcode, >- categorycode => $self->check_recalls ? $self->check_recalls->patron->categorycode : undef, >- itemtype => $self->effective_itemtype, >- rules => [ >- 'recalls_allowed', >- ], >- }); >+ my $most_relevant_recall = $self->check_recalls; >+ my $rule = Koha::CirculationRules->get_effective_rules( >+ { >+ branchcode => $branchcode, >+ categorycode => $most_relevant_recall ? $most_relevant_recall->patron->categorycode : undef, >+ itemtype => $self->effective_itemtype, >+ rules => [ 'recalls_allowed', ], >+ } >+ ); > > # check recalls allowed has been set and is not zero > return 0 if ( !defined($rule->{recalls_allowed}) || $rule->{recalls_allowed} == 0 ); >-- >2.40.1
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 32129
:
143449
|
145795
|
147529
| 151160