diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php
index 44e870b12de..a7609f02b25 100644
--- a/htdocs/modulebuilder/template/myobject_list.php
+++ b/htdocs/modulebuilder/template/myobject_list.php
@@ -709,6 +709,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']);
@@ -780,9 +783,9 @@ while ($i < $imaxinloop) {
print '';
}
print '';
- }
- if (!$i) {
- $totalarray['nbfield']++;
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
}
print ''."\n";