fix: use form model data to determine participant index

This commit is contained in:
Björn Fromme
2025-03-25 14:30:26 +01:00
parent 172b0007a8
commit 368ce28537
+3 -2
View File
@@ -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)) {