diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index b807ea23334..9df3a04a786 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -319,6 +319,7 @@ class Mailing extends CommonObject if ($result < 0) { $this->error=$object->error; + $this->errors=array_merge($this->errors, $object->errors); $error++; } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 511fb2087ec..647be1d0233 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1285,7 +1285,12 @@ class Propal extends CommonObject // Create clone $object->context['createfromclone']='createfromclone'; $result=$object->create($user); - if ($result < 0) $error++; + if ($result < 0) + { + $this->error = $object->error; + $this->errors = array_merge($this->errors, $object->errors); + $error++; + } if (! $error) { diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 76b0ab6f247..5bb557cac2c 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4951,7 +4951,7 @@ abstract class CommonObject if ($this->array_options[$key] === '') $mandatorypb=true; if ($mandatorypb) { - dol_syslog($this->error); + dol_syslog("Mandatory extra field ".$key." is empty"); $this->errors[]=$langs->trans('ErrorFieldRequired', $attributeLabel); return -1; } diff --git a/htdocs/product/class/productbatch.class.php b/htdocs/product/class/productbatch.class.php index d16c6ccc6ec..ab86a63b8e0 100644 --- a/htdocs/product/class/productbatch.class.php +++ b/htdocs/product/class/productbatch.class.php @@ -356,6 +356,7 @@ class Productbatch extends CommonObject if ($result < 0) { $this->error=$object->error; + $this->errors=array_merge($this->errors, $object->errors); $error++; } diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index d39849780c1..425b29080bf 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -924,7 +924,8 @@ class Productcustomerprice extends CommonObject // Other options if ($result < 0) { $this->error = $object->error; - $error ++; + $this->errors=array_merge($this->errors, $object->errors); + $error++; } if (! $error) { diff --git a/htdocs/product/class/propalmergepdfproduct.class.php b/htdocs/product/class/propalmergepdfproduct.class.php index 3aeae37249c..861b86ec257 100644 --- a/htdocs/product/class/propalmergepdfproduct.class.php +++ b/htdocs/product/class/propalmergepdfproduct.class.php @@ -589,6 +589,7 @@ class Propalmergepdfproduct extends CommonObject if ($result < 0) { $this->error=$object->error; + $this->errors=array_merge($this->errors, $object->errors); $error++; }