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

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1ef0b3c471)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
This commit is contained in:
Jonathan Druart 2015-10-27 09:21:24 +00:00 committed by Frédéric Demians
parent 22a6fb9e96
commit 0dc59ab982
2 changed files with 4 additions and 3 deletions

View File

@ -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;

View File

@ -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,