From a497a81aac9a62991b452dc87c0e001cefc4bba6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Feb 2019 19:09:27 +0100 Subject: [PATCH] Update api_contacts.class.php --- htdocs/societe/class/api_contacts.class.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/societe/class/api_contacts.class.php b/htdocs/societe/class/api_contacts.class.php index 5b29e92b6dd..e6ba5c8beac 100644 --- a/htdocs/societe/class/api_contacts.class.php +++ b/htdocs/societe/class/api_contacts.class.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2019 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -177,16 +178,17 @@ class Contacts extends DolibarrApi { $num = $db->num_rows($result); $min = min($num, ($limit <= 0 ? $num : $limit)); + $i = 0; while ($i < $min) { $obj = $db->fetch_object($result); $contact_static = new Contact($db); if ($contact_static->fetch($obj->rowid)) { - if ($includecount) - { - $contact_static->load_ref_elements(); - } + if ($includecount) + { + $contact_static->load_ref_elements(); + } $obj_ret[] = $this->_cleanObjectDatas($contact_static); }