fix: use form model data to determine participant index
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user