diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 0e996d560edd9..19a8df1b9e257 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -470,16 +470,13 @@ $no_email = GETPOST('no_email', 'int'); $result = $object->setNoEmail($no_email); if ($result < 0) { + $error++; setEventMessages($object->error, $object->errors, 'errors'); - $action = 'edit'; } } - - $action = 'view'; } else { $error++; setEventMessages($object->error, $object->errors, 'errors'); - $action = 'edit'; } } } @@ -489,6 +486,9 @@ header("Location: ".$backtopage); exit; } + $action = 'view'; + } else { + $action = 'edit'; } }