Commit 38a0b9eb by Julien Jorry

Fix bug on saveHelloAsso submit if not exist

parent a3eb9c7b
......@@ -50,7 +50,7 @@ class AdhesionController extends AbstractController
if ($form->isSubmitted()) {
if ($form->isValid()) {
// CB PAIEMENT USE PAYZEN
if ($form->get('save')->isClicked()) {
if ($form->has('save') && $form->get('save')->isClicked()) {
$adherentNew = $form->getData();
// Serialize form data in json to store with payment object and persist when payment is valid
......@@ -76,7 +76,7 @@ class AdhesionController extends AbstractController
'extra_data' => $jsondata,
]);
// HELLOASSO PAIEMENT
} elseif ($form->get('saveHelloAsso')->isClicked()) {
} elseif ($form->has('saveHelloAsso') && $form->get('saveHelloAsso')->isClicked()) {
$adherentNew = $form->getData();
$usergroup = $this->em->getRepository(Usergroup::class)->findOneByName('Adherent');
$adherentNew->getUser()->addPossiblegroup($usergroup);
......
......@@ -100,14 +100,14 @@ class UserAdherentController extends FluxController
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
if ($form->get('payOther')->isClicked()) {
if ($form->has('payOther') && $form->get('payOther')->isClicked()) {
return $this->redirectToRoute('achatMonnaieAConfirmerAdherent');
} elseif ($form->get('save')->isClicked()) {
} elseif ($form->has('save') && $form->get('save')->isClicked()) {
return $this->preparePaymentAction(
$form,
Payment::TYPE_ACHAT_MONNAIE_ADHERENT
);
} elseif ($form->get('saveHelloAsso')->isClicked()) {
} elseif ($form->has('saveHelloAsso') && $form->get('saveHelloAsso')->isClicked()) {
$url = $this->em->getRepository(GlobalParameter::class)->val(GlobalParameter::HELLOASSO_URL_EMLC_ADHERENT);
return $this->redirect($url);
......
......@@ -252,9 +252,9 @@ class UserPrestataireController extends FluxController
if ($achat->getDon() && 0 == $achat->getDon()->getMontant()) {
$achat->setDon(null);
}
if ($form->get('payOther')->isClicked()) {
if ($form->has('payOther') && $form->get('payOther')->isClicked()) {
return $this->redirectToRoute('achatMonnaieAConfirmerPrestataire');
} elseif ($form->get('saveHelloAsso')->isClicked()) {
} elseif ($form->has('saveHelloAsso') && $form->get('saveHelloAsso')->isClicked()) {
$url = $this->em->getRepository(GlobalParameter::class)->val(GlobalParameter::HELLOASSO_URL_EMLC_PRESTATAIRE);
return $this->redirect($url);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment