From 41b5af909241af77dc11b0051f1c214b7a01efc8 Mon Sep 17 00:00:00 2001 From: Serreau Jovann Date: Fri, 13 Feb 2026 14:41:44 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20d=C3=A9sactiver=20Turbo=20sur=20les=20fo?= =?UTF-8?q?rmulaires=20de=20r=C3=A9initialisation=20et=20d'inscription?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Les formulaires de réinitialisation de mot de passe et d'inscription utilisaient Turbo par défaut, ce qui pouvait interférer avec le processus de soumission standard et la redirection après action. L'ajout de l'attribut `data-turbo="false"` sur chaque formulaire concerné garantit que les requêtes POST sont traitées de manière conventionnelle, évitant ainsi des comportements inattendus ou des échecs de soumission. --- ansible/playbook.yml | 4 ++-- src/Controller/Dashboard/FlowController.php | 18 ------------------ .../Dashboard/PrestaireController.php | 8 ++++---- src/Controller/Dashboard/ProductController.php | 4 ++-- 4 files changed, 8 insertions(+), 26 deletions(-) diff --git a/ansible/playbook.yml b/ansible/playbook.yml index 65050ac..69e7fa3 100644 --- a/ansible/playbook.yml +++ b/ansible/playbook.yml @@ -88,7 +88,7 @@ MAILER_DSN=ses+smtp://AKIAWTT2T22CWBRBBDYN:BBdgb6KxRQ8mNcpWFJsZCJxbSGNdgLhKFiITMErfBlQP@default?region=eu-west-3 PATH_URL=https://intranet.ludikevent.fr STRIPE_BASEURL=https://payment.ludikevent.fr - SIGN_URL=https://signature.ludikevent.fr + SIGN_URL=https://reservation.ludikevent.fr DEFAULT_URI=https://reservation.ludikevent.fr INTRANET_LOCK=false STRIPE_PK=pk_test_51SUA22173W4aeFB1nO6oFfDZ12HOTffDKtCshhZ8rkUg6kUO2ZaQC0tK72rhE79Tr8treeHX9KMcZtvcQZ0X8VSm00Q6GQ365V @@ -250,4 +250,4 @@ - "{{ path }}/public/media" - "{{ path }}/public/pdf" - "{{ path }}/public/seo" - - "{{ path }}/public/tmp-sign" \ No newline at end of file + - "{{ path }}/public/tmp-sign" diff --git a/src/Controller/Dashboard/FlowController.php b/src/Controller/Dashboard/FlowController.php index 1fda884..ee8f642 100644 --- a/src/Controller/Dashboard/FlowController.php +++ b/src/Controller/Dashboard/FlowController.php @@ -132,23 +132,6 @@ class FlowController extends AbstractController $devis->setIsNotAddCaution(true); } - // Set Prestataire from session to devis (needs to be added to Devis entity too if not already, but Contrats has it) - // Since Devis transforms to Contrats, we'll need to ensure Contrats gets this info. - // For now, let's assume Devis doesn't strictly need it unless we add the field to Devis too. - // Wait, the user asked to add 'selecteur pour choisir le prestaire en charge de la livraison' in the view. - // And I added the relation to OrderSession. - // When Devis is signed and becomes Contrat, Contrat has the relation. - // So we should probably store it on Devis as well or just pass it through. - // Let's check Devis entity if I can add it there too, or if I just rely on OrderSession link. - // Actually, creating Devis here. - // We should add 'prestataire' to Devis entity as well to persist this choice through the flow. - // Or, when creating Contrat from Devis later, we check the OrderSession linked to Devis. - // Let's update Devis entity to be safe and consistent. - // For this step I'll just update the controller logic to SET it if Devis has it. - // I will check Devis entity in a moment. - - // 3. Addresses - // Billing Address $billAddr = $this->findOrCreateAddress( $session->getCustomer(), $session->getBillingAddress() ?: $session->getAdressEvent(), @@ -282,7 +265,6 @@ class FlowController extends AbstractController $this->eventDispatcher->dispatch(new DevisSend($devis)); } catch (\Exception $e) { - dd($e->getMessage()); $this->appLogger->record('ERROR', 'Erreur génération PDF Devis auto: ' . $e->getMessage()); } diff --git a/src/Controller/Dashboard/PrestaireController.php b/src/Controller/Dashboard/PrestaireController.php index 6ff0d67..ddec743 100644 --- a/src/Controller/Dashboard/PrestaireController.php +++ b/src/Controller/Dashboard/PrestaireController.php @@ -53,7 +53,7 @@ class PrestaireController extends AbstractController // Génération mot de passe aléatoire temporaire $plainPassword = bin2hex(random_bytes(10)); $prestataire->setPassword($passwordHasher->hashPassword($prestataire, $plainPassword)); - + // Rôles par défaut $prestataire->setRoles(['ROLE_PRESTAIRE']); @@ -114,12 +114,12 @@ class PrestaireController extends AbstractController ]); } - #[Route('/delete/{id}', name: 'app_crm_prestataire_delete', options: ['sitemap' => false], methods: ['POST'])] + #[Route('/delete/{id}', name: 'app_crm_prestataire_delete', options: ['sitemap' => false], methods: ['GET'])] public function delete(Prestaire $prestataire, Request $request): Response { - if ($this->isCsrfTokenValid('delete' . $prestataire->getId(), $request->request->get('_token'))) { + if ($this->isCsrfTokenValid('delete' . $prestataire->getId(), $request->query->get('_token'))) { $name = $prestataire->getSurname() . ' ' . $prestataire->getName(); - + $this->em->remove($prestataire); $this->em->flush(); diff --git a/src/Controller/Dashboard/ProductController.php b/src/Controller/Dashboard/ProductController.php index 5691eb4..ab5055a 100644 --- a/src/Controller/Dashboard/ProductController.php +++ b/src/Controller/Dashboard/ProductController.php @@ -351,10 +351,10 @@ class ProductController extends AbstractController 'templates' => $templateRepo->findAll() ]); } - #[Route(path: '/crm/products/delete/{id}', name: 'app_crm_product_delete', methods: ['POST'])] + #[Route(path: '/crm/products/delete/{id}', name: 'app_crm_product_delete', methods: ['GET'])] public function productDelete(Product $product, EntityManagerInterface $em, Request $request, AppLogger $logger, Client $stripe): Response { - if ($this->isCsrfTokenValid('delete'.$product->getId(), $request->request->get('_token'))) { + if ($this->isCsrfTokenValid('delete'.$product->getId(), $request->query->get('_token'))) { $name = $product->getName(); $stripe->deleteProduct($product); $em->remove($product);