Merge pull request #23613 from noec764/14_FIX_Errors_handling_CreateFrom_Hooks
FIX: Errors Handling for CreateFrom Hooks
This commit is contained in:
commit
0fd085d5bb
@ -708,6 +708,8 @@ class ActionComm extends CommonObject
|
||||
$action = '';
|
||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
$this->errors += $hookmanager->errors;
|
||||
$this->error = $hookmanager->error;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -567,6 +567,7 @@ if (empty($reshook)) {
|
||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been
|
||||
// modified by hook
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
$error++;
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -1412,6 +1412,8 @@ class Propal extends CommonObject
|
||||
$action = '';
|
||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
$this->errors += $hookmanager->errors;
|
||||
$this->error = $hookmanager->error;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -445,6 +445,7 @@ if (empty($reshook)) {
|
||||
// Note that $action and $object may be modified by hook
|
||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action);
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
$error++;
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -1252,6 +1252,8 @@ class Commande extends CommonOrder
|
||||
$action = '';
|
||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
$this->errors += $hookmanager->errors;
|
||||
$this->error = $hookmanager->error;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
@ -1406,6 +1408,8 @@ class Commande extends CommonOrder
|
||||
$action = '';
|
||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
$this->errors += $hookmanager->errors;
|
||||
$this->error = $hookmanager->error;
|
||||
$error++;
|
||||
}
|
||||
|
||||
|
||||
@ -1299,6 +1299,8 @@ class Facture extends CommonInvoice
|
||||
$action = '';
|
||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
$this->errors += $hookmanager->errors;
|
||||
$this->error = $hookmanager->error;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
@ -1432,6 +1434,8 @@ class Facture extends CommonInvoice
|
||||
$action = '';
|
||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
$this->errors += $hookmanager->errors;
|
||||
$this->error = $hookmanager->error;
|
||||
$error++;
|
||||
}
|
||||
|
||||
|
||||
@ -341,6 +341,7 @@ if (empty($reshook)) {
|
||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been
|
||||
// modified by hook
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
$error++;
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -2564,6 +2564,8 @@ class Contrat extends CommonObject
|
||||
$action = '';
|
||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $clonedObj, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
$this->errors += $hookmanager->errors;
|
||||
$this->error = $hookmanager->error;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -455,6 +455,8 @@ class ExpenseReport extends CommonObject
|
||||
$action = '';
|
||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
$this->errors += $hookmanager->errors;
|
||||
$this->error = $hookmanager->error;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1211,6 +1211,8 @@ class Fichinter extends CommonObject
|
||||
$action = '';
|
||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
$this->errors += $hookmanager->errors;
|
||||
$this->error = $hookmanager->error;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1654,6 +1654,8 @@ class CommandeFournisseur extends CommonOrder
|
||||
$action = '';
|
||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
$this->errors += $hookmanager->errors;
|
||||
$this->error = $hookmanager->error;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1314,6 +1314,7 @@ if (empty($reshook)) {
|
||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been
|
||||
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
$error++;
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -407,6 +407,7 @@ if (empty($reshook)) {
|
||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been
|
||||
// modified by hook
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
$error++;
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -1160,6 +1160,8 @@ class SupplierProposal extends CommonObject
|
||||
$action = '';
|
||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
$this->errors += $hookmanager->errors;
|
||||
$this->error = $hookmanager->error;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user