Commit 1984c318 by Mathieu Poisbeau

Fix #180

parent ed1727e0
...@@ -56,7 +56,12 @@ class UserPrestataireController extends FluxController ...@@ -56,7 +56,12 @@ class UserPrestataireController extends FluxController
*/ */
public function groupePrestataireInscriptionAction(Request $request) public function groupePrestataireInscriptionAction(Request $request)
{ {
$form = $this->createForm(GroupePrestataireInscriptionFormType::class, $this->session->get('_prestagere')); //#180: at this point, the Prestataire entity is detached from the EntityManager (because we get it from the session)
$presta = $this->session->get('_prestagere');
//#180: $presta now refers to the fully managed copy returned by the merge operation.
$presta = $this->em->merge($presta);
$form = $this->createForm(GroupePrestataireInscriptionFormType::class, $presta);
$form->handleRequest($request); $form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) { if ($form->isSubmitted() && $form->isValid()) {
......
...@@ -134,7 +134,13 @@ class FormFactory ...@@ -134,7 +134,13 @@ class FormFactory
if (empty($user) || empty($this->session->get('_prestagere'))) { if (empty($user) || empty($this->session->get('_prestagere'))) {
throw new \Exception("[FORM 6] Opération impossible !"); throw new \Exception("[FORM 6] Opération impossible !");
} }
$form = $this->ff->create(GroupePrestataireInscriptionFormType::class, $this->session->get('_prestagere'), array('action' => $this->router->generate('groupeprestataire_inscription')));
//#180: at this point, the Prestataire entity is detached from the EntityManager (because we get it from the session)
$presta = $this->session->get('_prestagere');
//#180: $presta now refers to the fully managed copy returned by the merge operation.
$presta = $this->em->merge($presta);
$form = $this->ff->create(GroupePrestataireInscriptionFormType::class, $presta, array('action' => $this->router->generate('groupeprestataire_inscription')));
return $form->createView(); return $form->createView();
} }
......
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