diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index b5d643abc98..42abde0e09b 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -292,12 +292,15 @@ if (empty($reshook)) // Fill array 'array_options' with data from update form $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute')); - if ($ret < 0) $error++; + if ($ret < 0) { $error++; } if (! $error) { $result = $object->insertExtraFields(); - if ($result < 0) $errors = $object->errors; - + if ($result < 0) + { + $error++; + $errors = $object->errors; + } } if ($error) $action = 'edit_extras'; }