From 70c72bba9ba343c0a642a4848d69613c99c6603b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Wed, 11 Aug 2021 20:41:17 +0200 Subject: [PATCH] Fix civility to have default value and not forced value --- Form/RegisterType.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- 2.41.1