diff --git a/lib/classes/calendar/SingleCalendar.php b/lib/classes/calendar/SingleCalendar.php index ee467fb79898534859e67fab49bdc659139ac761..8aa0ac69fd59a093e6fa33d9ee4be772b18617c7 100644 --- a/lib/classes/calendar/SingleCalendar.php +++ b/lib/classes/calendar/SingleCalendar.php @@ -579,7 +579,15 @@ class SingleCalendar if ($consultation_event) { //Check if the slot is empty and delete it, if so. if ($consultation_event->slot) { - if (empty($consultation_event->slot->events)) { + //Count other consultation events: + $other_event_c = ConsultationEvent::countBySql( + 'slot_id = :slot_id AND event_id <> :event_id', + [ + 'slot_id' => $consultation_event->slot->id, + 'event_id' => $consultation_event->event_id + ] + ); + if ($other_event_c == 0) { foreach ($consultation_event->slot->bookings as $booking) { $booking->cancel(); }