Search code examples
symfonysonata-adminsymfony-2.3

Sonata Exception get too many admin registered


I get the message:

Unable to found a valid admin for the class: Aman\VarshneyBundle\Entity\ArticleTable, get too many admin registered: sonata.admin.appsreview,sonata.admin.review,sonata.admin.article

I am not able to figure out this issue.


Solution

  • you have to specify "admin_code" option in your field definition

    in your admin class while building your form

    protected function configureFormFields(FormMapper $formMapper)
    {
        $formMapper->add('user', 'entity', array(), array(
            'admin_code' => 'your.user.admin.service'
    
        ));
    }
    

    It only happens when you have multiple admin classes for the same entity.