diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 1bca4579070..dd072e19a2f 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -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);