Quantcast
Channel: Active questions tagged symfony4 - Stack Overflow
Viewing all articles
Browse latest Browse all 3925

Expected argument of type "string", "null" given at property path

$
0
0

Actually when I try to edit the form by sending empty fields, the above error comes on ,

My UserType class looks like:

class UserType extends AbstractType{    public function buildForm(FormBuilderInterface $builder, array $options)    {        $builder            ->add('firstName', null, ['label' => 'Prénom'            ])            ->add('lastName', null, ['label' => 'Nom'            ])            ->add('email', EmailType::class, ['label' => 'Adresse e-mail'            ])            ->add('password', PasswordType::class, ['label' => 'Mot de passe'            ])        ;    }    public function configureOptions(OptionsResolver $resolver)    {        $resolver->setDefaults(['data_class' => User::class,        ]);    }}

Viewing all articles
Browse latest Browse all 3925

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>