Bugzilla – Attachment 113659 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: Update callers for changed return
Bug-27002-Update-callers-for-changed-return.patch (text/plain), 3.13 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-11-16 11:23:09 UTC
(
hide
)
Description:
Bug 27002: Update callers for changed return
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-11-16 11:23:09 UTC
Size:
3.13 KB
patch
obsolete
>From 19746d71079b67f516b43d4c371405ac79c3b8e1 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 13 Nov 2020 13:53:15 +0000 >Subject: [PATCH] Bug 27002: Update callers for changed return > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/REST/V1/Holds.pm | 2 +- > Koha/Template/Plugin/Branches.pm | 4 ++-- > t/db_dependent/Koha/Biblio.t | 2 +- > t/db_dependent/Template/Plugin/Branches.t | 3 ++- > 4 files changed, 6 insertions(+), 5 deletions(-) > >diff --git a/Koha/REST/V1/Holds.pm b/Koha/REST/V1/Holds.pm >index 60acb5ad618..30579caa403 100644 >--- a/Koha/REST/V1/Holds.pm >+++ b/Koha/REST/V1/Holds.pm >@@ -419,7 +419,7 @@ sub pickup_locations { > my @pickup_locations = > $hold->itemnumber > ? @{ $hold->item->pickup_locations( { patron => $hold->patron } )->as_list() } >- : @{ $hold->biblio->pickup_locations( { patron => $hold->patron } ) }; >+ : @{ $hold->biblio->pickup_locations( { patron => $hold->patron } )->as_list() }; > > @pickup_locations = map { $_->to_api } @pickup_locations; > >diff --git a/Koha/Template/Plugin/Branches.pm b/Koha/Template/Plugin/Branches.pm >index f0bbf40cd70..80ef90e83c0 100644 >--- a/Koha/Template/Plugin/Branches.pm >+++ b/Koha/Template/Plugin/Branches.pm >@@ -123,13 +123,13 @@ sub pickup_locations { > elsif ($biblio) { > $biblio = Koha::Biblios->find($biblio) > unless ref($biblio) eq 'Koha::Biblio'; >- @libraries = @{ $biblio->pickup_locations( { patron => $patron } ) } >+ @libraries = $biblio->pickup_locations( { patron => $patron } ) > if defined $biblio; > } > } > > @libraries = Koha::Libraries->search( { pickup_location => 1 }, >- { order_by => ['branchname'] } )->as_list >+ { order_by => ['branchname'] } ) > unless @libraries; > > @libraries = map { $_->unblessed } @libraries; >diff --git a/t/db_dependent/Koha/Biblio.t b/t/db_dependent/Koha/Biblio.t >index cf359edf325..d4aac6399d2 100755 >--- a/t/db_dependent/Koha/Biblio.t >+++ b/t/db_dependent/Koha/Biblio.t >@@ -387,7 +387,7 @@ subtest 'pickup_locations' => sub { > my ( $cbranch, $biblio, $patron, $results ) = @_; > t::lib::Mocks::mock_preference('ReservesControlBranch', $cbranch); > >- my @pl = @{ $biblio->pickup_locations( { patron => $patron} ) }; >+ my @pl = $biblio->pickup_locations( { patron => $patron } ); > > foreach my $pickup_location (@pl) { > is( ref($pickup_location), 'Koha::Library', 'Object type is correct' ); >diff --git a/t/db_dependent/Template/Plugin/Branches.t b/t/db_dependent/Template/Plugin/Branches.t >index 4c149dfc698..377a36e061c 100755 >--- a/t/db_dependent/Template/Plugin/Branches.t >+++ b/t/db_dependent/Template/Plugin/Branches.t >@@ -155,7 +155,8 @@ subtest 'pickup_locations() tests' => sub { > $biblio_class->mock( > 'pickup_locations', > sub { >- return [$library_2]; >+ return Koha::Libraries->search( >+ { branchcode => $library_2->branchcode } ); > } > ); > >-- >2.29.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 27002
:
113548
|
113610
|
113611
|
113612
|
113628
|
113629
|
113642
|
113643
|
113658
| 113659