From ebe30f7a0ed744dbb6668fc47396085fa1327d69 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Feb 2019 19:19:23 +0100 Subject: [PATCH 1/5] FIX error report not returned --- htdocs/comm/mailing/class/mailing.class.php | 1 + htdocs/comm/propal/class/propal.class.php | 7 ++++++- htdocs/core/class/commonobject.class.php | 2 +- htdocs/product/class/productbatch.class.php | 1 + htdocs/product/class/productcustomerprice.class.php | 3 ++- htdocs/product/class/propalmergepdfproduct.class.php | 1 + 6 files changed, 12 insertions(+), 3 deletions(-) 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++; } From 273d68381c8b7174fa746913abf56d8cf90bdc50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 3 Feb 2019 15:21:21 +0100 Subject: [PATCH 2/5] psr2 end file new line none found --- dev/setup/codesniffer/ruleset.xml | 2 +- htdocs/admin/perms.php | 2 +- htdocs/blockedlog/ajax/check_signature.php | 2 +- htdocs/compta/cashcontrol/class/cashcontrol.class.php | 2 +- htdocs/core/actions_comments.inc.php | 2 +- htdocs/core/class/emailsenderprofile.class.php | 2 +- htdocs/core/lib/fiscalyear.lib.php | 2 +- htdocs/core/modules/modDon.class.php | 2 +- htdocs/core/modules/modSupplierProposal.class.php | 2 +- .../modules/reception/doc/doc_generic_reception_odt.modules.php | 2 +- htdocs/core/modules/reception/mod_reception_beryl.php | 2 +- htdocs/core/modules/reception/mod_reception_moonstone.php | 2 +- htdocs/core/modules/syslog/logHandler.php | 2 +- htdocs/core/modules/syslog/logHandlerInterface.php | 2 +- htdocs/core/modules/syslog/mod_syslog_syslog.php | 2 +- htdocs/core/tpl/advtarget.tpl.php | 2 +- htdocs/core/tpl/extrafields_list_search_input.tpl.php | 2 +- htdocs/core/tpl/extrafields_list_search_title.tpl.php | 2 +- htdocs/datapolicy/class/datapolicycron.class.php | 2 +- htdocs/reception/class/reception.class.php | 2 +- htdocs/takepos/ajax.php | 2 +- htdocs/variants/ajax/get_attribute_values.php | 2 +- htdocs/variants/class/ProductAttribute.class.php | 2 +- htdocs/variants/class/ProductAttributeValue.class.php | 2 +- htdocs/variants/class/ProductCombination2ValuePair.class.php | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index b5c1ae5b6a9..2ce66d75739 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -432,5 +432,5 @@ - + diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index e7cf64d768e..e3ef8417dca 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -220,4 +220,4 @@ dol_fiche_end(); // End of page llxFooter(); -$db->close(); \ No newline at end of file +$db->close(); diff --git a/htdocs/blockedlog/ajax/check_signature.php b/htdocs/blockedlog/ajax/check_signature.php index 9617e6cd1ef..51a98244c40 100644 --- a/htdocs/blockedlog/ajax/check_signature.php +++ b/htdocs/blockedlog/ajax/check_signature.php @@ -57,4 +57,4 @@ $url = $conf->global->BLOCKEDLOG_AUTHORITY_URL.'/blockedlog/ajax/authority.php?s $res = file_get_contents($url); //echo $url; -echo $res; \ No newline at end of file +echo $res; diff --git a/htdocs/compta/cashcontrol/class/cashcontrol.class.php b/htdocs/compta/cashcontrol/class/cashcontrol.class.php index 946658208df..492d8b79875 100644 --- a/htdocs/compta/cashcontrol/class/cashcontrol.class.php +++ b/htdocs/compta/cashcontrol/class/cashcontrol.class.php @@ -426,4 +426,4 @@ class CashControl extends CommonObject return $result; } -} \ No newline at end of file +} diff --git a/htdocs/core/actions_comments.inc.php b/htdocs/core/actions_comments.inc.php index ee45a035043..83af2cd53cb 100644 --- a/htdocs/core/actions_comments.inc.php +++ b/htdocs/core/actions_comments.inc.php @@ -73,4 +73,4 @@ if ($action == 'deletecomment') $action=''; } } -} \ No newline at end of file +} diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index 3ce9623a05d..b99a5e708d3 100644 --- a/htdocs/core/class/emailsenderprofile.class.php +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -447,4 +447,4 @@ class EmailSenderProfileLine // @var mixed Sample line property 2 public $prop2; } -*/ \ No newline at end of file +*/ diff --git a/htdocs/core/lib/fiscalyear.lib.php b/htdocs/core/lib/fiscalyear.lib.php index 6ea24bfacc2..3fb57dd55eb 100644 --- a/htdocs/core/lib/fiscalyear.lib.php +++ b/htdocs/core/lib/fiscalyear.lib.php @@ -53,4 +53,4 @@ function fiscalyear_prepare_head(Fiscalyear $object) complete_head_from_modules($conf,$langs,$object,$head,$h,'fiscalyear','remove'); return $head; -} \ No newline at end of file +} diff --git a/htdocs/core/modules/modDon.class.php b/htdocs/core/modules/modDon.class.php index f92c1cea2a5..d30b93a0410 100644 --- a/htdocs/core/modules/modDon.class.php +++ b/htdocs/core/modules/modDon.class.php @@ -162,4 +162,4 @@ class modDon extends DolibarrModules return $this->_init($sql,$options); } -} \ No newline at end of file +} diff --git a/htdocs/core/modules/modSupplierProposal.class.php b/htdocs/core/modules/modSupplierProposal.class.php index 43d42d7b8c3..c61289e2cbf 100644 --- a/htdocs/core/modules/modSupplierProposal.class.php +++ b/htdocs/core/modules/modSupplierProposal.class.php @@ -257,4 +257,4 @@ class modSupplierProposal extends DolibarrModules return $this->_remove($sql, $options); } -} \ No newline at end of file +} diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php index e9b616cb0e2..35271ca7f7d 100644 --- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php +++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php @@ -519,4 +519,4 @@ class doc_generic_reception_odt extends ModelePdfReception return -1; } -} \ No newline at end of file +} diff --git a/htdocs/core/modules/reception/mod_reception_beryl.php b/htdocs/core/modules/reception/mod_reception_beryl.php index 071c7f732c3..7665079fd0b 100644 --- a/htdocs/core/modules/reception/mod_reception_beryl.php +++ b/htdocs/core/modules/reception/mod_reception_beryl.php @@ -143,4 +143,4 @@ class mod_reception_beryl extends ModelNumRefReception // phpcs:enable return $this->getNextValue($objsoc,$objforref); } -} \ No newline at end of file +} diff --git a/htdocs/core/modules/reception/mod_reception_moonstone.php b/htdocs/core/modules/reception/mod_reception_moonstone.php index ae4c4b42b48..a91dcaf5729 100644 --- a/htdocs/core/modules/reception/mod_reception_moonstone.php +++ b/htdocs/core/modules/reception/mod_reception_moonstone.php @@ -134,4 +134,4 @@ class mod_reception_moonstone extends ModelNumRefReception // phpcs:enable return $this->getNextValue($objsoc,$objforref); } -} \ No newline at end of file +} diff --git a/htdocs/core/modules/syslog/logHandler.php b/htdocs/core/modules/syslog/logHandler.php index fa013f4b083..b2e50933b87 100644 --- a/htdocs/core/modules/syslog/logHandler.php +++ b/htdocs/core/modules/syslog/logHandler.php @@ -97,4 +97,4 @@ class LogHandler { $this->ident+=$ident; } -} \ No newline at end of file +} diff --git a/htdocs/core/modules/syslog/logHandlerInterface.php b/htdocs/core/modules/syslog/logHandlerInterface.php index 6f59482a1c0..76764a5c8a3 100644 --- a/htdocs/core/modules/syslog/logHandlerInterface.php +++ b/htdocs/core/modules/syslog/logHandlerInterface.php @@ -83,4 +83,4 @@ interface LogHandlerInterface * @return void */ public function export($content); -} \ No newline at end of file +} diff --git a/htdocs/core/modules/syslog/mod_syslog_syslog.php b/htdocs/core/modules/syslog/mod_syslog_syslog.php index 1f2f499fbac..26232e91ed5 100644 --- a/htdocs/core/modules/syslog/mod_syslog_syslog.php +++ b/htdocs/core/modules/syslog/mod_syslog_syslog.php @@ -124,4 +124,4 @@ class mod_syslog_syslog extends LogHandler implements LogHandlerInterface syslog($content['level'], $content['message']); closelog(); } -} \ No newline at end of file +} diff --git a/htdocs/core/tpl/advtarget.tpl.php b/htdocs/core/tpl/advtarget.tpl.php index af8c99c3fc7..268a971b51c 100644 --- a/htdocs/core/tpl/advtarget.tpl.php +++ b/htdocs/core/tpl/advtarget.tpl.php @@ -527,4 +527,4 @@ print '