From ec6f363dac2f13f05c2c220f4ef89a99737db9e5 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 27 Oct 2015 09:21:24 +0000 Subject: [PATCH] Bug 15066: Make transfer rotating collection works under Plack This patch the 2 following errors: Undefined subroutine &C4::RotatingCollections::transferbook called at C4/RotatingCollections.pm line 451. Undefined subroutine &C4::RotatingCollections::GetTransfers called at C4/RotatingCollections.pm line 450. And this warning: "my" variable $colId masks earlier declaration in same scope at /home/koha/src/rotating_collections/transferCollection.pl line 75. Test plan: Create a rotating collection Transfer it to another branch It should work with this patch --- C4/RotatingCollections.pm | 4 ++-- rotating_collections/transferCollection.pl | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/C4/RotatingCollections.pm b/C4/RotatingCollections.pm index dd80cdd..0562a78 100644 --- a/C4/RotatingCollections.pm +++ b/C4/RotatingCollections.pm @@ -447,8 +447,8 @@ sub TransferCollection { my @results; while ( my $item = $sth->fetchrow_hashref ) { my ($status) = CheckReserves( $item->{itemnumber} ); - my @transfers = GetTransfers( $item->{itemnumber} ); - transferbook( $colBranchcode, $item->{barcode}, my $ignore_reserves = 1 ) unless ( $status eq 'Waiting' || @transfers ); + my @transfers = C4::Circulation::GetTransfers( $item->{itemnumber} ); + C4::Circulation::transferbook( $colBranchcode, $item->{barcode}, my $ignore_reserves = 1 ) unless ( $status eq 'Waiting' || @transfers ); } return 1; diff --git a/rotating_collections/transferCollection.pl b/rotating_collections/transferCollection.pl index afc7cef..fc29a4b 100755 --- a/rotating_collections/transferCollection.pl +++ b/rotating_collections/transferCollection.pl @@ -72,7 +72,8 @@ foreach my $br ( keys %$branches ) { @branchoptionloop = sort {$a->{name} cmp $b->{name}} @branchoptionloop; ## Get data about collection -my ( $colId, $colTitle, $colDesc, $colBranchcode ) = GetCollection($colId); +my ( $colTitle, $colDesc, $colBranchcode ); +( $colId, $colTitle, $colDesc, $colBranchcode ) = GetCollection($colId); $template->param( colId => $colId, colTitle => $colTitle, -- 2.1.0