Bugzilla – Attachment 113612 Details for
Bug 27002
Make Koha::Biblio->pickup_locations return a Koha::Libraries resultset
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27002: (follow-up) Fix empty Koha::Item->pickup_locations
Bug-27002-follow-up-Fix-empty-KohaItem-pickuplocat.patch (text/plain), 1.85 KB, created by
Martin Renvoize (ashimema)
on 2020-11-13 16:11:10 UTC
(
hide
)
Description:
Bug 27002: (follow-up) Fix empty Koha::Item->pickup_locations
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-11-13 16:11:10 UTC
Size:
1.85 KB
patch
obsolete
>From 5a575bfac0f4d1135139d575fea56fa577d3a1e2 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 13 Nov 2020 16:06:25 +0000 >Subject: [PATCH] Bug 27002: (follow-up) Fix empty Koha::Item->pickup_locations > >In Koha::Item pickup_locations we were using the Koha::Objects->empty to >return an effectively empty Koha::Libraries object. However, this only >sets the result cache to an empty arrayref and as such only affect >iterators and not subsequent chained queries (like the get_column I call >to get back a DBIx::Class:ResultSetColumn in this patchset). As such, >this patch updates the Koha::Item->pickup_locations method to use an >always empty search ->search(\'0 = 1') to fulfil the same purpose as the >prior call to empty and return an empty set that is available for both >iterating and query chaining. >--- > Koha/Item.pm | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/Koha/Item.pm b/Koha/Item.pm >index 10d4eb2c48..2d4a5882a2 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -573,8 +573,8 @@ sub pickup_locations { > C4::Circulation::GetBranchItemRule( $circ_control_branch, $self->itype ); > > if(defined $patron) { >- return Koha::Libraries->new()->empty if $branchitemrule->{holdallowed} == 3 && !$self->home_branch->validate_hold_sibling( {branchcode => $patron->branchcode} ); >- return Koha::Libraries->new()->empty if $branchitemrule->{holdallowed} == 1 && $self->home_branch->branchcode ne $patron->branchcode; >+ return Koha::Libraries->search(\'0 = 1') if $branchitemrule->{holdallowed} == 3 && !$self->home_branch->validate_hold_sibling( {branchcode => $patron->branchcode} ); >+ return Koha::Libraries->search(\'0 = 1') if $branchitemrule->{holdallowed} == 1 && $self->home_branch->branchcode ne $patron->branchcode; > } > > my $pickup_libraries = Koha::Libraries->search(); >-- >2.20.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 27002
:
113548
|
113610
|
113611
|
113612
|
113628
|
113629
|
113642
|
113643
|
113658
|
113659