From a64e676dad0472f5f5eb72c702da8ef453f566e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 31 Oct 2020 09:40:15 +0100 Subject: [PATCH] fix undefined variable --- htdocs/projet/class/api_projects.class.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/projet/class/api_projects.class.php b/htdocs/projet/class/api_projects.class.php index f060f56e615..a0875ee2001 100644 --- a/htdocs/projet/class/api_projects.class.php +++ b/htdocs/projet/class/api_projects.class.php @@ -146,8 +146,7 @@ class Projects extends DolibarrApi $sql .= $this->db->order($sortfield, $sortorder); if ($limit) { - if ($page < 0) - { + if ($page < 0) { $page = 0; } $offset = $limit * $page; @@ -162,8 +161,8 @@ class Projects extends DolibarrApi { $num = $this->db->num_rows($result); $min = min($num, ($limit <= 0 ? $num : $limit)); - while ($i < $min) - { + $i = 0; + while ($i < $min) { $obj = $this->db->fetch_object($result); $project_static = new Project($this->db); if ($project_static->fetch($obj->rowid)) {