Bug 7567: QA followup: FIX SQL query

The WHERE clause should not erase $query.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This commit is contained in:
Jonathan Druart 2014-03-27 13:14:08 +01:00 committed by Galen Charlton
parent 53f15f678f
commit ea6cffdd9f

View file

@ -150,7 +150,7 @@ sub get_opac_news {
FROM opac_news LEFT JOIN branches
ON opac_news.branchcode=branches.branchcode
};
$query = ' WHERE 1';
$query .= ' WHERE 1';
if ($lang) {
$query .= " AND (opac_news.lang='' OR opac_news.lang=?)";
push @values,$lang;