diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php
index 78e7c31077b..8cdbd1f9938 100644
--- a/htdocs/modulebuilder/template/myobject_list.php
+++ b/htdocs/modulebuilder/template/myobject_list.php
@@ -716,6 +716,9 @@ while ($i < $imaxinloop) {
print '';
}
print '';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
}
foreach ($object->fields as $key => $val) {
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
@@ -787,9 +790,9 @@ while ($i < $imaxinloop) {
print '';
}
print '';
- }
- if (!$i) {
- $totalarray['nbfield']++;
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
}
print ''."\n";