From 7b163d3b29a4d5a1423c267b4a57c6d75c07361b Mon Sep 17 00:00:00 2001 From: phf Date: Mon, 25 May 2015 17:36:36 +0200 Subject: [PATCH] FIX : create contact with extrafiel is null when it is require --- htdocs/contact/card.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 248352dfee3..3b9a9948889 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -200,8 +200,12 @@ if (empty($reshook)) // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels,$object); - if ($ret < 0) $error++; - + if ($ret < 0) + { + $error++; + $action = 'create'; + } + if (! GETPOST("lastname")) { $error++; $errors[]=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname").' / '.$langs->transnoentities("Label"));