diff --git a/src/Form/BookingParticipantType.php b/src/Form/BookingParticipantType.php index 395f822..4d2c2f1 100644 --- a/src/Form/BookingParticipantType.php +++ b/src/Form/BookingParticipantType.php @@ -205,8 +205,8 @@ class BookingParticipantType extends AbstractType if ($this->fieldStateProvider->shouldIncludeField('gender', $bookingDto, $participantIndex)) { $form->add('gender', ChoiceType::class, $this->mergeFieldState([ 'label' => 'Gender', - 'required' => false, - 'placeholder' => 'keine Angabe', + 'required' => !$personalDataOptional, + 'placeholder' => $personalDataOptional ? 'keine Angabe' : false, 'choices' => [ 'männlich' => 'M', 'weiblich' => 'W', diff --git a/src/Form/Model/ParticipantDto.php b/src/Form/Model/ParticipantDto.php index 8ee3c91..3118c09 100644 --- a/src/Form/Model/ParticipantDto.php +++ b/src/Form/Model/ParticipantDto.php @@ -52,7 +52,11 @@ class ParticipantDto #[Assert\NotBlank(message: 'Bitte angeben', groups: ['strict_required'])] public ?string $lastName = null; public ?string $title = null; + + #[Assert\NotBlank(message: 'Bitte angeben', groups: ['strict_required'])] public ?string $gender = null; + + #[Assert\NotBlank(message: 'Bitte angeben', groups: ['strict_required'])] public ?string $nationality = null; public ?string $height = null;