From ea7aa11d7152ff2167c4198cb640f5b52c947ec5 Mon Sep 17 00:00:00 2001 From: Colin Campbell Date: Thu, 18 Feb 2010 12:35:28 +0000 Subject: [PATCH] Make GetBooksellerFromId error return consistent return undef or empty array in error cases hopefully if we're consistent someone may start checking it removed unnecessary ()s Signed-off-by: Galen Charlton --- C4/Bookseller.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/C4/Bookseller.pm b/C4/Bookseller.pm index 655d25edca..63df90d83c 100644 --- a/C4/Bookseller.pm +++ b/C4/Bookseller.pm @@ -87,7 +87,7 @@ sub GetBookSeller($) { sub GetBookSellerFromId($) { - my ($id) = shift or return undef; + my $id = shift or return; my $dbh = C4::Context->dbh(); my $query = "SELECT * FROM aqbooksellers WHERE id = ?"; my $sth =$dbh->prepare($query); @@ -96,9 +96,9 @@ sub GetBookSellerFromId($) { my $sth2 = $dbh->prepare("SELECT count(*) FROM aqbasket WHERE booksellerid=?"); $sth2->execute($id); $data->{basketcount}=$sth2->fetchrow(); - return ($data); + return $data; } - return 0; + return; } #-----------------------------------------------------------------# -- 2.39.5