diff --git a/src/Bundle/ChillEventBundle/Controller/EventController.php b/src/Bundle/ChillEventBundle/Controller/EventController.php index 46f6f200d..7bcc8dbe6 100644 --- a/src/Bundle/ChillEventBundle/Controller/EventController.php +++ b/src/Bundle/ChillEventBundle/Controller/EventController.php @@ -78,6 +78,7 @@ final class EventController extends AbstractController /** @var array $participations */ $participations = $event->getParticipations(); + $budgetElements = $event->getBudgetElements(); $form = $this->createDeleteForm($event_id); @@ -89,6 +90,10 @@ final class EventController extends AbstractController $em->remove($participation); } + foreach ($budgetElements as $e) { + $em->remove($e); + } + $em->remove($event); $em->flush(); diff --git a/src/Bundle/ChillEventBundle/Controller/ParticipationController.php b/src/Bundle/ChillEventBundle/Controller/ParticipationController.php index 2449528de..7fac83bf5 100644 --- a/src/Bundle/ChillEventBundle/Controller/ParticipationController.php +++ b/src/Bundle/ChillEventBundle/Controller/ParticipationController.php @@ -228,7 +228,7 @@ final class ParticipationController extends AbstractController } return $this->redirectToRoute('chill_event__event_show', [ - 'event_id' => $participation->getEvent()->getId(), + 'id' => $participation->getEvent()->getId(), ]); } @@ -242,7 +242,7 @@ final class ParticipationController extends AbstractController /** * @param int $participation_id */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/event/participation/{participation_id}/delete', name: 'chill_event_participation_delete', requirements: ['participation_id' => '\d+'], methods: ['GET', 'DELETE'])] + #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/event/participation/{participation_id}/delete', name: 'chill_event_participation_delete', requirements: ['participation_id' => '\d+'])] public function deleteAction($participation_id, Request $request): Response|\Symfony\Component\HttpFoundation\RedirectResponse { $em = $this->managerRegistry->getManager(); @@ -273,7 +273,7 @@ final class ParticipationController extends AbstractController ); return $this->redirectToRoute('chill_event__event_show', [ - 'event_id' => $event->getId(), + 'id' => $event->getId(), ]); } } @@ -442,7 +442,7 @@ final class ParticipationController extends AbstractController )); return $this->redirectToRoute('chill_event__event_show', [ - 'event_id' => $participation->getEvent()->getId(), + 'id' => $participation->getEvent()->getId(), ]); } diff --git a/src/Bundle/ChillEventBundle/Resources/views/Event/confirm_delete.html.twig b/src/Bundle/ChillEventBundle/Resources/views/Event/confirm_delete.html.twig index c3a13b55a..a7666f149 100644 --- a/src/Bundle/ChillEventBundle/Resources/views/Event/confirm_delete.html.twig +++ b/src/Bundle/ChillEventBundle/Resources/views/Event/confirm_delete.html.twig @@ -12,7 +12,7 @@ 'title' : 'Delete event'|trans, 'confirm_question' : 'Are you sure you want to remove that event ?'|trans, 'cancel_route' : activeRouteKey, - 'cancel_parameters' : { 'event_id' : event_id }, + 'cancel_parameters' : { 'id' : id }, 'form' : delete_form } ) }} diff --git a/src/Bundle/ChillEventBundle/Resources/views/Event/list.html.twig b/src/Bundle/ChillEventBundle/Resources/views/Event/list.html.twig index 4bdb1f0f8..b376050b4 100644 --- a/src/Bundle/ChillEventBundle/Resources/views/Event/list.html.twig +++ b/src/Bundle/ChillEventBundle/Resources/views/Event/list.html.twig @@ -34,7 +34,7 @@