diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index fad19564fdc..2070bedf568 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -440,7 +440,7 @@ class MyObject extends CommonObject if ($resql) { $num = $this->db->num_rows($resql); $i = 0; - while ($i < min($limit, $num)) + while ($i < ($limit ? min($limit, $num) : $num)) { $obj = $this->db->fetch_object($resql);