diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index aeb99aad125..6c4be4bf97f 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7829,7 +7829,6 @@ abstract class CommonObject $sqlwhere .= " AND entity = " . ((int) $conf->entity); } $sql .= $sqlwhere; - //print $sql; // Note: $InfoFieldList can be 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter[:CategoryIdType[:CategoryIdList[:Sortfield]]]]]]' if (isset($InfoFieldList[7]) && preg_match('/^[a-z0-9_\-,]+$/i', $InfoFieldList[7])) { @@ -7837,6 +7836,8 @@ abstract class CommonObject } else { $sql .= " ORDER BY ".$this->db->sanitize(implode(', ', $fields_label)); } + $sql .= ' LIMIT ' . getDolGlobalString('MAIN_EXTRAFIELDS_LIMIT_SELLIST_SQL', 1000); + // print $sql; dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG); $resql = $this->db->query($sql);