From 4ddc1087f20f5f30c11900dbf4df51317fedfc10 Mon Sep 17 00:00:00 2001 From: Albin Date: Wed, 3 Jul 2024 21:36:49 +0200 Subject: [PATCH] Corrige le BUG de modification d'un ticket sponsor issue#1512 --- sources/AppBundle/Controller/TicketController.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sources/AppBundle/Controller/TicketController.php b/sources/AppBundle/Controller/TicketController.php index ebfadb89c..7efbe37c5 100644 --- a/sources/AppBundle/Controller/TicketController.php +++ b/sources/AppBundle/Controller/TicketController.php @@ -110,8 +110,11 @@ public function sponsorTicketFormAction(Request $request, $eventSlug) $ticketForm = $this->createForm(SponsorTicketType::class, $ticket, ['with_transport' => $event->getTransportInformationEnabled()]); $ticketForm->handleRequest($request); - if ($ticketForm->isSubmitted() && $ticketForm->isValid() && $sponsorTicket->getPendingInvitations() > 0) { - if ($event->getDateEndSalesSponsorToken() < new \DateTime()) { + if ($ticketForm->isSubmitted() && $ticketForm->isValid()) { + // Si c'est l'ajout d'un ticket + // Et qu'il n'y a plus d'invitation + // ou que la date du sponsoring est pas passée + if ($ticket->getId() === null && ($sponsorTicket->getPendingInvitations() <= 0 || $event->getDateEndSalesSponsorToken() < new \DateTime())) { return $this->render(':event/ticket:sold_out.html.twig', ['event' => $event]); }