diff --git a/src/Form/BodyDimensionsType.php b/src/Form/BodyDimensionsType.php index ef85ac3..d459d57 100644 --- a/src/Form/BodyDimensionsType.php +++ b/src/Form/BodyDimensionsType.php @@ -2,6 +2,7 @@ namespace App\Form; +use App\Form\Model\ParticipantDto; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\FormBuilderInterface; @@ -55,7 +56,7 @@ class BodyDimensionsType extends AbstractType public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ - 'inherit_data' => true, + 'data_class' => ParticipantDto::class, 'height_required' => false, 'weight_required' => false, 'shoeSize_required' => false, diff --git a/src/Form/BookingParticipantType.php b/src/Form/BookingParticipantType.php index 4ca10f9..b86a063 100644 --- a/src/Form/BookingParticipantType.php +++ b/src/Form/BookingParticipantType.php @@ -311,7 +311,10 @@ class BookingParticipantType extends AbstractType } // Add property_path for wrapper DTO navigation - $fieldOptions['property_path'] = 'participant.'.$fieldName; + $propertyPath = $fieldOptions['property_path'] ?? $fieldName; + if (false === str_starts_with($propertyPath, 'participant.')) { + $fieldOptions['property_path'] = 'participant.'.$propertyPath; + } // Apply non-hidden field states (readonly, disabled, required) if (true === $this->fieldStateProvider->hasStateConditions($fieldName)) {