diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index ef0962a0169..6656141593c 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1192,6 +1192,7 @@ class Facture extends CommonInvoice if (($object->lines[$i]->info_bits & 0x02) == 0x02) // We do not clone line of discounts { unset($object->lines[$i]); + continue; } // Bloc to update dates of service (month by month only if previously filled and similare to start and end of month) @@ -1218,7 +1219,7 @@ class Facture extends CommonInvoice } } - $object->lines[$i]->ref_ext = ''; // Do not clone ref_ext + $object->lines[$i]->ref_ext = ''; // Do not clone ref_ext } // Create clone diff --git a/htdocs/core/lib/modulebuilder.lib.php b/htdocs/core/lib/modulebuilder.lib.php index ff14ec56e18..f0da3bad3ea 100644 --- a/htdocs/core/lib/modulebuilder.lib.php +++ b/htdocs/core/lib/modulebuilder.lib.php @@ -51,7 +51,7 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir = } // Check parameters - if (count($addfieldentry) > 0) + if (is_array($addfieldentry) && count($addfieldentry) > 0) { if (empty($addfieldentry['name'])) {