From 3eb754b995f05246d4f5ce3443ff8890b68c5c94 Mon Sep 17 00:00:00 2001 From: btoumi Date: Wed, 7 Jun 2006 07:50:04 +0000 Subject: [PATCH] bug fix: syntax error in sub getbranches --- C4/Koha.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/C4/Koha.pm b/C4/Koha.pm index 7dd57e87a6..3d6abb7fc3 100644 --- a/C4/Koha.pm +++ b/C4/Koha.pm @@ -120,6 +120,7 @@ sub getbranches { # returns a reference to a hash of references to branches... my ($type) = @_; my %branches; + my $branch; my $dbh = C4::Context->dbh; my $sth; if (C4::Context->preference("IndependantBranches") && (C4::Context->userenv->{flags}!=1)){ @@ -131,7 +132,7 @@ sub getbranches { $sth = $dbh->prepare("Select * from branches order by branchname"); } $sth->execute; - while (my $branch=$sth->fetchrow_hashref) { + while ($branch=$sth->fetchrow_hashref) { my $nsth = $dbh->prepare("select categorycode from branchrelations where branchcode = ?"); if ($type){ $nsth = $dbh->prepare("select categorycode from branchrelations where branchcode = ? and categorycode = ?"); @@ -158,7 +159,7 @@ sub getbranches { if (!$type){ $branches{$branch->{'branchcode'}}=$branch; } - } + return (\%branches); } -- 2.39.5