From 9dc42e9ec4bb6ab0511000018adaa0f7883c905f Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 11 Jun 2012 04:45:57 -0400 Subject: [PATCH] Bug 8223 - Properly format SQL query in C4::Bookseller::GetBookSeller Signed-off-by: Martin Renvoize Signed-off-by: Paul Poulain --- C4/Bookseller.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/C4/Bookseller.pm b/C4/Bookseller.pm index 4b8e2a5149..5874a93681 100644 --- a/C4/Bookseller.pm +++ b/C4/Bookseller.pm @@ -63,9 +63,12 @@ aqbooksellers table in the Koha database. sub GetBookSeller { my $searchstring = shift; $searchstring = q{%} . $searchstring . q{%}; - my $query = -'select aqbooksellers.*, count(*) as basketcount from aqbooksellers left join aqbasket ' - . 'on aqbasket.booksellerid = aqbooksellers.id where name like ? group by aqbooksellers.id order by name'; + my $query = " + SELECT aqbooksellers.*, count(*) AS basketcount + FROM aqbooksellers + LEFT JOIN aqbasket ON aqbasket.booksellerid = aqbooksellers.id + WHERE name LIKE ? GROUP BY aqbooksellers.id ORDER BY name + "; my $dbh = C4::Context->dbh; my $sth = $dbh->prepare($query); -- 2.39.5