0
votes

I am trying to use sonata as my backed. I am now trying to set up some users. I have installed the fosuserbundle but when I try to get sonata-project/user-bundle I get this:

  Problem 1
    - sonata-project/user-bundle 2.2.2 requires sonata-project/admin-bundle ~2.2.7 -> no matching package found.
    - sonata-project/user-bundle 2.2.1 requires sonata-project/admin-bundle ~2.2.7 -> no matching package found.
    - sonata-project/user-bundle 2.2.0 requires sonata-project/admin-bundle ~2.2.7 -> no matching package found.
    - Installation request for symfony/framework-standard-edition 2.6.x-dev -> satisfiable by symfony/framework-standard-edition[2.6.x-dev].
    - symfony/framework-standard-edition 2.6.x-dev requires sonata-project/user-bundle ~2.2 -> satisfiable by sonata-project/user-bundle[2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4].
    - sonata-project/user-bundle 2.2.3 requires friendsofsymfony/user-bundle ~1.3 -> satisfiable by friendsofsymfony/user-bundle[1.3.x-dev].
    - sonata-project/user-bundle 2.2.4 requires friendsofsymfony/user-bundle ~1.3 -> satisfiable by friendsofsymfony/user-bundle[1.3.x-dev].
    - Conclusion: don't install friendsofsymfony/user-bundle 1.3.x-dev

I was looking at the sonata sandbox and in the AppKernel.php they have the following:

        // USER
        new FOS\UserBundle\FOSUserBundle(),
        new Sonata\UserBundle\SonataUserBundle('FOSUserBundle'),
        new Application\Sonata\UserBundle\ApplicationSonataUserBundle(),

I can't find the requirement for FOSUserBundle in their composer file.

Can anyone explain to me what I am doing wrong? I just want to have a simple admin with user management so that I can have something that requires logged in users to access.

Using: PHP 5.4.36-0+deb7u1 (cli) Symfony 2.6.3

Thanks

UPDATE

I have followed HypeR suggestion and I now have the correct bundles.

There is a problem with the login. I have created the application bundle and it expects a fos_user_user table. How do I create this??

I try to login and get an error saying that the table fos_user_user does not exist.

1

1 Answers

1
votes

You should follow the installation documentation on how to install SonataUserBundle.

To have user management, you need to install FosUserBundle. At the moment Sonata doesn't support the last version of FosUserBundle that's why you have to install the 1.3 version. There is more details about that on this issue.

Then you need to install the 2 dependencies of SonataUserBundle : SonataAdminBundle & SonataEasyExtendsBundle.

Then you can follow the install documentation of SonataUserBundle.

Good luck !

Update

It seems that your database is missing some tables, you should go in the root directory of your project and do in command line :

php app/console doctrine:schema:update --force

You can check the mysql queries that are about to be executed with the --force by using :

php app/console doctrine:schema:update --dump-sql

Check if you did all the steps of the installation of FOSUserBundle 1.3 : https://github.com/FriendsOfSymfony/FOSUserBundle/blob/1.3.x/Resources/doc/index.md