Skip to content

Commit

Permalink
Fix civility getter (#11517)
Browse files Browse the repository at this point in the history
Co-authored-by: Rémi <[email protected]>
  • Loading branch information
Remg and Rémi authored Feb 24, 2025
1 parent 079d90c commit dfb6aa4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Form/NationalEvent/EventInscriptionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ class EventInscriptionType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
/** @var Adherent|null $adherent */
$adherent = $options['adherent'];
$isAdherent = $adherent instanceof Adherent;

$builder
->add('email', EmailType::class, ['disabled' => $isAdherent])
->add('civility', GenderCivilityType::class, ['disabled' => $isAdherent && $adherent->getCivility()])
->add('civility', GenderCivilityType::class, ['disabled' => $isAdherent && $adherent->getGender()])
->add('firstName', TextType::class, ['disabled' => $isAdherent && $adherent->getFirstName()])
->add('lastName', TextType::class, ['disabled' => $isAdherent && $adherent->getLastName()])
->add('birthPlace', TextType::class)
Expand Down

0 comments on commit dfb6aa4

Please sign in to comment.