1

I try to install Sonata User Bundle but I have a problem on configuration when I execute the command

app/console sonata:easy-extends:generate SonataUserBundle -d src

The git bash show this error :

 [Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException]
  The service "sonata.user.orm.group_manager" has a dependency on a non-exist
  ent parameter "fos_user.model.group.class". Did you mean this: "fos_user.mo
  del.user.class"?
chalasr
  • 12,971
  • 4
  • 40
  • 82
Aouadi Adib
  • 33
  • 2
  • 7

2 Answers2

8

In your configuration, you must have the following :

# app/config/sonata/user.yml or app/config/config.yml
fos_user:
    db_driver:      orm # can be orm or odm
    firewall_name:  main
    user_class:     FOS\UserBundle\Entity\User     #Default configuration
    # ...
    group:
        group_class:   FOS\UserBundle\Entity\Group
        group_manager: sonata.user.orm.group_manager

You can replace FOSUserBundle entities by your own.

chalasr
  • 12,971
  • 4
  • 40
  • 82
0

You must install and configure the FOSUserBundle because SonataUserBundle is a bundle for integrate FOSUserBundle into a SonataProject.

You can read this installation doc for understand : SonataUserBundle Install

Did you notice the FosUserBundle into your AppKernel.php file like this :

public function registerbundles()
{
    return array(
        new Sonata\CoreBundle\SonataCoreBundle(),
        new Sonata\BlockBundle\SonataBlockBundle(),
        new Sonata\EasyExtendsBundle\SonataEasyExtendsBundle(),
        // ...
        // You have 2 options to initialize the SonataUserBundle in your AppKernel,
        // you can select which bundle SonataUserBundle extends
        // Most of the cases, you'll want to extend FOSUserBundle though ;)
        // extend the ``FOSUserBundle``
        new FOS\UserBundle\FOSUserBundle(),
        new Sonata\UserBundle\SonataUserBundle('FOSUserBundle'),
        // OR
        // the bundle will NOT extend ``FOSUserBundle``
        new Sonata\UserBundle\SonataUserBundle(),
        // ...
    );
}
miltone
  • 4,416
  • 11
  • 42
  • 76