From 368ce28537bcc80cd227c30c71a62841b26a20c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Tue, 25 Mar 2025 14:30:26 +0100 Subject: [PATCH] fix: use form model data to determine participant index --- src/Form/ParticipantType.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Form/ParticipantType.php b/src/Form/ParticipantType.php index ea288d9..ae6576c 100644 --- a/src/Form/ParticipantType.php +++ b/src/Form/ParticipantType.php @@ -323,9 +323,10 @@ class ParticipantType extends AbstractType } // forcibly select mandatory services that potentially have been disabled in PRE_SET_DATA - $mandatoryServices = array_filter($options['selectable_services'], function (Service $service) use ($data) { + $mandatoryServices = array_filter($options['selectable_services'], function (Service $service) use ($form) { + $participantIndex = $form->getData()->index; return true === $service->mandatory || - (Service::SOURCE_BOOKING === $service->source && in_array($data['index'], $service->mapping)); + (Service::SOURCE_BOOKING === $service->source && in_array($participantIndex, $service->mapping)); }); if (0 < count($mandatoryServices)) {