Fix missing error message

This commit is contained in:
Laurent Destailleur 2018-05-22 19:24:56 +02:00
parent 7de812d2ed
commit be21405d21

View File

@ -638,8 +638,11 @@ if (empty($reshook))
$result = $object->update($socid, $user, 1, $object->oldcopy->codeclient_modifiable(), $object->oldcopy->codefournisseur_modifiable(), 'update', 0);
if ($result <= 0)
{
$error = $object->error; $errors = $object->errors;
$error++;
$errors = $object->errors;
setEventMessages($object->error, $object->errors, 'errors');
}
// Prevent thirdparty's emptying if a user hasn't rights $user->rights->categorie->lire (in such a case, post of 'custcats' is not defined)
if(!empty($user->rights->categorie->lire)){
// Customer categories association
@ -718,6 +721,7 @@ if (empty($reshook))
{
$error++;
$object->error .= $object->db->lasterror();
setEventMessages($object->error, $object->errors, 'errors');
}
}