Fix bug #933: Ajax error

Caused by commit 7e53f98
This commit is contained in:
Marcos García
2013-06-08 22:29:18 +02:00
parent c8a634fa08
commit f0454926c2
2 changed files with 3 additions and 5 deletions

View File

@@ -1307,9 +1307,8 @@ class Form
}
if (strval($filtertype) != '') $sql.=" AND p.fk_product_type=".$filtertype;
// Add criteria on ref/label
if ($filterkey && $filterkey != '')
if ($filterkey != '')
{
$sql.=" AND (";
if (! empty($conf->global->PRODUCT_DONOTSEARCH_ANYWHERE)) // Can use index
{
$sql.=" AND (p.ref LIKE '".$filterkey."%' OR p.label LIKE '".$filterkey."%'";
@@ -1331,7 +1330,6 @@ class Form
{
$sql .= " OR p.barcode LIKE '".$filterkey."'";
}
$sql.=")";
}
$sql.= $db->order("p.ref");
$sql.= $db->plimit($limit);