From 5ac23e7ee494c8f76c4e967af89e9231808fd6ea Mon Sep 17 00:00:00 2001
From: Nick Clemens <nick@bywatersolutions.com>
Date: Wed, 11 Nov 2020 14:09:24 +0000
Subject: [PATCH] Bug 26963: [GOLF] Fix cases where we expected a list

---
 Koha/Biblio.pm                   | 2 +-
 Koha/Template/Plugin/Branches.pm | 2 +-
 reserve/request.pl               | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm
index 29c7d1edb4..4368eef386 100644
--- a/Koha/Biblio.pm
+++ b/Koha/Biblio.pm
@@ -220,7 +220,7 @@ sub pickup_locations {
 
     my @pickup_locations;
     foreach my $item_of_bib ($self->items->as_list) {
-        push @pickup_locations, @{ $item_of_bib->pickup_locations( {patron => $patron} ) };
+        push @pickup_locations, @{ $item_of_bib->pickup_locations( {patron => $patron} )->as_list() };
     }
 
     my %seen;
diff --git a/Koha/Template/Plugin/Branches.pm b/Koha/Template/Plugin/Branches.pm
index 05932dac68..cfcf68f53a 100644
--- a/Koha/Template/Plugin/Branches.pm
+++ b/Koha/Template/Plugin/Branches.pm
@@ -117,7 +117,7 @@ sub pickup_locations {
         if ($item) {
             $item = Koha::Items->find($item)
               unless ref($item) eq 'Koha::Item';
-            @libraries = @{ $item->pickup_locations( { patron => $patron } ) }
+            @libraries = @{ $item->pickup_locations( { patron => $patron } )->as_list() }
               if defined $item;
         }
         elsif ($biblio) {
diff --git a/reserve/request.pl b/reserve/request.pl
index 4df90a78a0..7e4c2c5819 100755
--- a/reserve/request.pl
+++ b/reserve/request.pl
@@ -572,7 +572,7 @@ foreach my $biblionumber (@biblionumbers) {
                         $item->{pickup_locations_code} = 'all';
                     } else {
                         my $arr_locations = Koha::Items->find($itemnumber)
-                                    ->pickup_locations( { patron => $patron } );
+                                    ->pickup_locations( { patron => $patron } )->as_list();
 
                         $item->{pickup_locations} = join( ', ',
                             map { $_->unblessed->{branchname} } @$arr_locations);
-- 
2.11.0