Fosuserbundle: Overrinding registration form: Could not load type <...>

Created on 3 Jan 2017  路  3Comments  路  Source: FriendsOfSymfony/FOSUserBundle

Hello,

I am facing the following issue while overriding the registration form:
Well, here are the symptoms:
This is the Form Type class:
//src/UserBundle/From/RegistrationForm.php
image
This is the service declaration statement:
//src/UserBundle/Ressources/config/services.yml - imported in //app/config/services.yml
image
And this is the FOSUserBundle config:
//app/config/config.yml
image

But at the end, the error still the same: Could not load type "toum_user_registration".
When I run "bin/console debug:container", I got a line
toum_user_registration UserBundleFormRegistrationType
So I believe my service is well declared but then, I don't have a clue where I forgot something.
Can someone help me with this? I read many other topics on that but none helpfull for me...

Thanks in advance,
Toum

Most helpful comment

I'm not following the development of the bundle exactly, but I'm going to guess.
If you are using symfony 3.x then form type is probably your class name and not service id/alias

All 3 comments

I'm not following the development of the bundle exactly, but I'm going to guess.
If you are using symfony 3.x then form type is probably your class name and not service id/alias

Hi mvrhoc,
Thanks for your answer. You re right! and then I have to change the getParent function in the new from type. It works!.
Thanks

@Toumm You can then also remove the getName() method from your form type and the alias attribute from the form.type tag of your service definition.

Was this page helpful?
0 / 5 - 0 ratings