From 97a5d7f9f1688de85ec39d616e27522430a4cd35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Thu, 8 Jan 2026 14:18:37 +0100 Subject: [PATCH] fix: include gender and nationality into group of mandatory fields --- src/Form/BookingParticipantType.php | 4 ++-- src/Form/Model/ParticipantDto.php | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) 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;