Bugzilla – Attachment 169250 Details for
Bug 36362
Only call Koha::Libraries->search() if necessary in Item::pickup_locations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36362: (QA follow-up) Tidy code
Bug-36362-QA-follow-up-Tidy-code.patch (text/plain), 2.87 KB, created by
Kyle M Hall (khall)
on 2024-07-19 16:36:31 UTC
(
hide
)
Description:
Bug 36362: (QA follow-up) Tidy code
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2024-07-19 16:36:31 UTC
Size:
2.87 KB
patch
obsolete
>From 621365b4c26321634c3d5bcec657546b03cf30b6 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 19 Jul 2024 12:23:43 -0400 >Subject: [PATCH] Bug 36362: (QA follow-up) Tidy code > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > Koha/Item.pm | 30 ++++++++++++++---------------- > 1 file changed, 14 insertions(+), 16 deletions(-) > >diff --git a/Koha/Item.pm b/Koha/Item.pm >index 18809f0b931..462e25c62fb 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -997,28 +997,26 @@ sub pickup_locations { > my $patron = $params->{patron}; > > my $circ_control_branch = Koha::Policy::Holds->holds_control_library( $self, $patron ); >- my $branchitemrule = >- C4::Circulation::GetBranchItemRule( $circ_control_branch, $self->itype ); >- >- if ( >- $branchitemrule->{holdallowed} eq 'from_local_hold_group' && >- !$self->home_branch->validate_hold_sibling( {branchcode => $patron->branchcode} ) || >- $branchitemrule->{holdallowed} eq 'from_home_library' && >- $self->home_branch->branchcode ne $patron->branchcode >- ) { >+ my $branchitemrule = C4::Circulation::GetBranchItemRule( $circ_control_branch, $self->itype ); >+ >+ if ( $branchitemrule->{holdallowed} eq 'from_local_hold_group' >+ && !$self->home_branch->validate_hold_sibling( { branchcode => $patron->branchcode } ) >+ || $branchitemrule->{holdallowed} eq 'from_home_library' >+ && $self->home_branch->branchcode ne $patron->branchcode ) >+ { > return Koha::Libraries->new()->empty; > } > > my $pickup_libraries; >- if ($branchitemrule->{hold_fulfillment_policy} eq 'holdgroup') { >+ if ( $branchitemrule->{hold_fulfillment_policy} eq 'holdgroup' ) { > $pickup_libraries = $self->home_branch->get_hold_libraries; >- } elsif ($branchitemrule->{hold_fulfillment_policy} eq 'patrongroup') { >- my $plib = Koha::Libraries->find({ branchcode => $patron->branchcode}); >+ } elsif ( $branchitemrule->{hold_fulfillment_policy} eq 'patrongroup' ) { >+ my $plib = Koha::Libraries->find( { branchcode => $patron->branchcode } ); > $pickup_libraries = $plib->get_hold_libraries; >- } elsif ($branchitemrule->{hold_fulfillment_policy} eq 'homebranch') { >- $pickup_libraries = Koha::Libraries->search({ branchcode => $self->homebranch }); >- } elsif ($branchitemrule->{hold_fulfillment_policy} eq 'holdingbranch') { >- $pickup_libraries = Koha::Libraries->search({ branchcode => $self->holdingbranch }); >+ } elsif ( $branchitemrule->{hold_fulfillment_policy} eq 'homebranch' ) { >+ $pickup_libraries = Koha::Libraries->search( { branchcode => $self->homebranch } ); >+ } elsif ( $branchitemrule->{hold_fulfillment_policy} eq 'holdingbranch' ) { >+ $pickup_libraries = Koha::Libraries->search( { branchcode => $self->holdingbranch } ); > } else { > $pickup_libraries = Koha::Libraries->search(); > } >-- >2.30.2
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 36362
:
163467
|
163468
|
166451
|
169249
| 169250