From 503b9c4da64ea9e0a3df5c22f39359aaf5705ba7 Mon Sep 17 00:00:00 2001 From: Colin Campbell Date: Thu, 23 Sep 2010 16:59:31 +0100 Subject: [PATCH] bug_5245 Fix SQL syntax in GetItems Content-Type: text/plain; charset="utf-8" Routine never executed query due to syntax error and returned undef made the call to fetchrow_array explicit as the old fetchrow alias is no longer documented in perldoc DBI --- C4/Serials.pm | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/C4/Serials.pm b/C4/Serials.pm index 032246c..9c22901 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -2082,15 +2082,15 @@ returns a count of items from serial matching the subscriptionid sub HasItems { my ($subscriptionid) = @_; my $dbh = C4::Context->dbh; - my $query = qq| + my $query = q| SELECT COUNT(serialitems.itemnumber) FROM serial LEFT JOIN serialitems USING(serialid) - WHERE subscriptionid=? AND serialitems.serialid NOT NULL + WHERE subscriptionid=? AND serialitems.serialid IS NOT NULL |; my $sth=$dbh->prepare($query); $sth->execute($subscriptionid); - my ($countitems)=$sth->fetchrow; + my ($countitems)=$sth->fetchrow_array(); return $countitems; } -- 1.7.2.3