From 6f84fc755b78bf690a2ef235c7a3428ed4b62173 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Mon, 3 Aug 2026 18:22:07 +0200 Subject: [PATCH] feat: replace board service placeholder to avoid duplicate entries --- src/Form/AccommodationStep2Type.php | 8 +------- src/Form/Model/AccommodationBookingDto.php | 1 + templates/groups/booking/step_2.html.twig | 18 +++--------------- 3 files changed, 5 insertions(+), 22 deletions(-) diff --git a/src/Form/AccommodationStep2Type.php b/src/Form/AccommodationStep2Type.php index 2d1fcd5..32ef6f2 100644 --- a/src/Form/AccommodationStep2Type.php +++ b/src/Form/AccommodationStep2Type.php @@ -40,8 +40,7 @@ class AccommodationStep2Type extends AbstractType 'choices' => $options['board_service_choices'], 'expanded' => true, 'multiple' => false, - 'required' => false, - 'placeholder' => 'Selbstversorgung', + 'required' => true, ]) ->add('selectedAdditionalServiceIds', ChoiceType::class, [ 'label' => false, @@ -65,11 +64,6 @@ class AccommodationStep2Type extends AbstractType } } - // Board service rendered manually: empty string from the "Selbstversorgung" radio → null - if (isset($data['selectedBoardServiceId']) && '' === $data['selectedBoardServiceId']) { - unset($data['selectedBoardServiceId']); - } - $event->setData($data); }); } diff --git a/src/Form/Model/AccommodationBookingDto.php b/src/Form/Model/AccommodationBookingDto.php index a8e37ba..2f5c658 100644 --- a/src/Form/Model/AccommodationBookingDto.php +++ b/src/Form/Model/AccommodationBookingDto.php @@ -25,6 +25,7 @@ class AccommodationBookingDto #[Assert\PositiveOrZero(message: 'invalid', groups: ['step_3'])] public int $childrenCount = 0; + #[Assert\NotNull(message: 'required', groups: ['step_2'])] public ?int $selectedBoardServiceId = null; /** @var list*/ diff --git a/templates/groups/booking/step_2.html.twig b/templates/groups/booking/step_2.html.twig index e00355c..ac6fd0e 100644 --- a/templates/groups/booking/step_2.html.twig +++ b/templates/groups/booking/step_2.html.twig @@ -81,20 +81,6 @@ Verpflegungsleistungen - - - - - {% for service in ctx.boardServices %}
- - - -
@@ -110,7 +96,9 @@
{% if service.price == 0 %}inkl.{% else %}{{ (service.price / 100)|format_currency(ctx.accommodation.currency) }}{% endif %}
-
pro Person und Nacht
+ {% if service.price != 0 %} +
pro Person und Nacht
+ {% endif %}