Merge pull request #22850 from daraelmin/patch-4

FIx #18304 No adh create if error on public form
This commit is contained in:
Laurent Destailleur 2022-11-15 13:12:02 +01:00 committed by GitHub
commit bb01ad7d9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -279,7 +279,10 @@ if ($action == 'add')
$ret = $extrafields->setOptionalsFromPost(null, $adh);
if ($ret < 0) $error++;
$result = $adh->create($user);
if (empty($error)) {
$result = $adh->create($user);
}
if ($result > 0)
{
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';