Commit 38a0b9eb by Julien Jorry

Fix bug on saveHelloAsso submit if not exist

parent a3eb9c7b
...@@ -50,7 +50,7 @@ class AdhesionController extends AbstractController ...@@ -50,7 +50,7 @@ class AdhesionController extends AbstractController
if ($form->isSubmitted()) { if ($form->isSubmitted()) {
if ($form->isValid()) { if ($form->isValid()) {
// CB PAIEMENT USE PAYZEN // CB PAIEMENT USE PAYZEN
if ($form->get('save')->isClicked()) { if ($form->has('save') && $form->get('save')->isClicked()) {
$adherentNew = $form->getData(); $adherentNew = $form->getData();
// Serialize form data in json to store with payment object and persist when payment is valid // Serialize form data in json to store with payment object and persist when payment is valid
...@@ -76,7 +76,7 @@ class AdhesionController extends AbstractController ...@@ -76,7 +76,7 @@ class AdhesionController extends AbstractController
'extra_data' => $jsondata, 'extra_data' => $jsondata,
]); ]);
// HELLOASSO PAIEMENT // HELLOASSO PAIEMENT
} elseif ($form->get('saveHelloAsso')->isClicked()) { } elseif ($form->has('saveHelloAsso') && $form->get('saveHelloAsso')->isClicked()) {
$adherentNew = $form->getData(); $adherentNew = $form->getData();
$usergroup = $this->em->getRepository(Usergroup::class)->findOneByName('Adherent'); $usergroup = $this->em->getRepository(Usergroup::class)->findOneByName('Adherent');
$adherentNew->getUser()->addPossiblegroup($usergroup); $adherentNew->getUser()->addPossiblegroup($usergroup);
......
...@@ -100,14 +100,14 @@ class UserAdherentController extends FluxController ...@@ -100,14 +100,14 @@ class UserAdherentController extends FluxController
$form->handleRequest($request); $form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) { if ($form->isSubmitted() && $form->isValid()) {
if ($form->get('payOther')->isClicked()) { if ($form->has('payOther') && $form->get('payOther')->isClicked()) {
return $this->redirectToRoute('achatMonnaieAConfirmerAdherent'); return $this->redirectToRoute('achatMonnaieAConfirmerAdherent');
} elseif ($form->get('save')->isClicked()) { } elseif ($form->has('save') && $form->get('save')->isClicked()) {
return $this->preparePaymentAction( return $this->preparePaymentAction(
$form, $form,
Payment::TYPE_ACHAT_MONNAIE_ADHERENT 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); $url = $this->em->getRepository(GlobalParameter::class)->val(GlobalParameter::HELLOASSO_URL_EMLC_ADHERENT);
return $this->redirect($url); return $this->redirect($url);
......
...@@ -252,9 +252,9 @@ class UserPrestataireController extends FluxController ...@@ -252,9 +252,9 @@ class UserPrestataireController extends FluxController
if ($achat->getDon() && 0 == $achat->getDon()->getMontant()) { if ($achat->getDon() && 0 == $achat->getDon()->getMontant()) {
$achat->setDon(null); $achat->setDon(null);
} }
if ($form->get('payOther')->isClicked()) { if ($form->has('payOther') && $form->get('payOther')->isClicked()) {
return $this->redirectToRoute('achatMonnaieAConfirmerPrestataire'); 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); $url = $this->em->getRepository(GlobalParameter::class)->val(GlobalParameter::HELLOASSO_URL_EMLC_PRESTATAIRE);
return $this->redirect($url); 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