From 705f3b6f76062e9162e6cb03850cf19a145b51a9 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 3 Mar 2025 13:25:08 +0100 Subject: [PATCH] Only change sms status upon cancellation if sendSMS is true --- .../ChillCalendarBundle/Controller/CalendarController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php b/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php index fb3022301..1a49aee0c 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php @@ -192,7 +192,9 @@ class CalendarController extends AbstractController if ($form->isSubmitted() && $form->isValid()) { $calendar->setStatus($calendar::STATUS_CANCELED); - $calendar->setSmsStatus($calendar::SMS_CANCEL_PENDING); + if ($calendar->getSendSMS()) { + $calendar->setSmsStatus($calendar::SMS_CANCEL_PENDING); + } $this->em->flush(); $this->addFlash('success', $this->translator->trans('chill_calendar.calendar_canceled'));