sonata-project/SonataAdminBundle — Issue #340: Passing Admin class trow bundle
Author: ilpega
Created: 2011-10-19 07:19:22+00:00
State: open

Hi everyone,
I use Sonata Admin + Sonata User + FOS User Bundle.
I made my Bundle that create some content save in a table. Alone it works fine but I want to integrate the form to create this content into the user creation form into SonataUserBundle (when you go to url your_web_app/sonata/user/user/create), because when the admin create a new user account, He has to put some additional informations that are stored in an Entity/Table of my Bundle.
I made the association relation of the table (with XML) and load, into the UserAdmin class into sonataUserBundle, the corresponding Entity of the another bundle, like:
use My\Bundle\Entity\MyEntity;

but it doesn't work. When I add some MyEntity field into configureFormFields function of UserAdmin, he returned the error
"Please define a type for field 'myField' in `Sonata\UserBundle\Admin\Entity\UserAdmin`"

When I define 'text' to the Type of myField, it give me a new error that there aren't the getMyField or isMyField method. Is like as the UserAdmin doesn't load or there are no associations with MyEntity into MyBundle.

Where is the error?

I insert into MyBundle the getParent to SonataUserAdmin, but it still give me the error "not getMyField method" just like before.
Thank you for any help.