From: Raphaƫl Gertz Date: Wed, 11 Aug 2021 18:41:17 +0000 (+0200) Subject: Fix civility to have default value and not forced value X-Git-Tag: 0.2.0~68 X-Git-Url: https://git.rapsys.eu/userbundle/commitdiff_plain/70c72bba9ba343c0a642a4848d69613c99c6603b?ds=sidebyside Fix civility to have default value and not forced value --- diff --git a/Form/RegisterType.php b/Form/RegisterType.php index bfedcf7..f4327c0 100644 --- a/Form/RegisterType.php +++ b/Form/RegisterType.php @@ -21,6 +21,7 @@ class RegisterType extends AbstractType { * {@inheritdoc} */ public function buildForm(FormBuilderInterface $builder, array $options) { + //Create form $form = $builder; //Add extra mail field @@ -30,7 +31,7 @@ class RegisterType extends AbstractType { //Add extra civility field if (!empty($options['civility'])) { - $form->add('civility', EntityType::class, ['class' => $options['civility_class'], 'attr' => ['placeholder' => 'Your civility'], 'constraints' => [new NotBlank(['message' => 'Please provide your civility'])], 'choice_translation_domain' => true, 'data' => $options['civility_default']]); + $form->add('civility', EntityType::class, ['class' => $options['civility_class'], 'attr' => ['placeholder' => 'Your civility'], 'constraints' => [new NotBlank(['message' => 'Please provide your civility'])], 'choice_translation_domain' => true, 'empty_data' => $options['civility_default']]); } //Add extra pseudonym field