Fix error management

This commit is contained in:
Laurent Destailleur 2019-05-31 11:53:30 +02:00
parent 12c1531b3b
commit f2088a084f
2 changed files with 24 additions and 23 deletions

View File

@ -377,6 +377,8 @@ if (empty($reshook))
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
if ($ret < 0) $error++;
if (! $error)
{
$result = $object->update($contactid, $user);
if ($result > 0) {
@ -394,6 +396,7 @@ if (empty($reshook))
$action = 'edit';
}
}
}
if (! $error && empty($errors))
{
@ -500,7 +503,7 @@ else
$linkback='';
print load_fiche_titre($title,$linkback,'title_companies.png');
// Affiche les erreurs
// Show errors
dol_htmloutput_errors(is_numeric($error)?'':$error, $errors);
if ($conf->use_javascript_ajax)
@ -775,8 +778,8 @@ else
$objsoc = new Societe($db);
$objsoc->fetch($object->socid);
// Affiche les erreurs
dol_htmloutput_errors($error,$errors);
// Show errors
dol_htmloutput_errors(is_numeric($error)?'':$error, $errors);
if ($conf->use_javascript_ajax)
{
@ -1073,11 +1076,10 @@ else
{
$objsoc = new Societe($db);
/*
* Fiche en mode visualisation
*/
// View mode
dol_htmloutput_errors($error,$errors);
// Show errors
dol_htmloutput_errors(is_numeric($error)?'':$error, $errors);
dol_fiche_head($head, 'card', $title, -1, 'contact');

View File

@ -1901,7 +1901,6 @@ class ExtraFields
$error_field_required[] = $langs->transnoentitiesnoconv($value);
}
}
if (in_array($key_type,array('date')))
{
// Clean parameters