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 <gmcharlt@gmail.com>
This commit is contained in:
parent
b83474516b
commit
ea7aa11d71
1 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
#-----------------------------------------------------------------#
|
||||
|
||||
|
|
Loading…
Reference in a new issue