2
votes

I have a conflict / problem between sonate admin and media bundle. Here is the error :

Runtime Notice: Declaration of Sonata\MediaBundle\Controller\MediaAdminController::render() should be compatible with Sonata\AdminBundle\Controller\CRUDController::render($view, array $parameters = Array, Symfony\Component\HttpFoundation\Response $response = NULL, Symfony\Component\HttpFoundation\Request $request = NULL)

The error happen while in the backend I try to interact with the media control panel (automaticaly added by the media bundle).

The only mention of this error on google is talking about dependencies issues.

https://github.com/sonata-project/SonataMediaBundle/issues/731

Here is the composer.json

 "sonata-project/admin-bundle": "dev-master",
 "sonata-project/doctrine-orm-admin-bundle": "^2.3",
 "sonata-project/media-bundle": "^2.3"

If to change for "sonata-project/media-bundle": "dev-master" it's also not working

The service "sonata.media.admin.media" has a dependency on a non-existent service "sonata.classification.manager.category". 

and anyway I'm not sure I want to use 'dev' packages.

Is this Sonata project still working ? the doc is outdated

I'm extremly tired of these sonata bundles - seems like a good idea but it's so time consuming to configure them properly ...

1
The primary cause of the installation problems in Sonata bundles is the fast evolution of Symfony and the sonata project. I agree with you, actually it's over complicated to get a clean installation of sonata bundles, usable for long term. The only advice I can give you is Try to use the same release version between all the sonata bundles of your app (it's ok for the most part) .chalasr

1 Answers

0
votes

So here is the trick :

in your composer.json you need to use the following version :

  "sonata-project/admin-bundle": "^2.3",
  "sonata-project/doctrine-orm-admin-bundle": "^2.3"

 "require-dev": {
        "sensio/generator-bundle": "~2.3", <== CHANGE THIS !!!

    },

in the require-dev you need to change "sensio/generator-bundle": "3.0" to "sensio/generator-bundle": "~2.3"

This doesn't solve the original issue, but will make sonata admin / media working together.

thx to chalasr for helping.