FIX : avoid SQL error when no sortfield send to method

This commit is contained in:
Florian HENRY 2015-09-23 12:10:38 +02:00
parent 00447f8e72
commit 84fa92045c

View File

@ -351,8 +351,9 @@ class Productcustomerprice extends CommonObject
}
}
}
$sql.= $this->db->order($sortfield, $sortorder);
if (!empty($sortfield)) {
$sql.= $this->db->order($sortfield, $sortorder);
}
if (! empty($limit)) $sql .= ' ' . $this->db->plimit($limit + 1, $offset);
dol_syslog(get_class($this) . "::fetch_all", LOG_DEBUG);