From 184c7733012fb42e26ac46c5c6efc921dc7da445 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 5 Mar 2018 15:43:48 +0100 Subject: [PATCH] Fix error management --- htdocs/adherents/subscription.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 8d4b7829925..5a50c92f3e9 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -284,7 +284,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! { if (! $_POST["label"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")); if ($_POST["paymentsave"] != 'invoiceonly' && ! $_POST["operation"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode")); - if ($_POST["paymentsave"] != 'invoiceonly' && ! $_POST["accountid"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("FinancialAccount")); + if ($_POST["paymentsave"] != 'invoiceonly' && ! ($_POST["accountid"] > 0)) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("FinancialAccount")); } else { @@ -293,6 +293,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! if ($errmsg) { setEventMessages($errmsg, null, 'errors'); + $error++; $action='addsubscription'; } }