[英]Sonata Admin / Media conflict (CRUDController)
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. 在Google上唯一提及此错误的地方是谈论依赖关系问题。
https://github.com/sonata-project/SonataMediaBundle/issues/731 https://github.com/sonata-project/SonataMediaBundle/issues/731
Here is the composer.json 这是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 如果要更改“ sonata-project / media-bundle”:“ dev-master”,它也无法正常工作
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. 无论如何,我不确定我是否要使用'dev'软件包。
Is this Sonata project still working ? 这个Sonata项目是否还在运作? 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 ... 我对这些奏鸣曲束感到非常厌倦-似乎是个好主意,但正确配置它们非常耗时...
So here is the trick : 所以这是窍门:
in your composer.json you need to use the following version : 在composer.json中,您需要使用以下版本:
"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" 在require-dev中,您需要将“ sensio / generator-bundle”:“ 3.0”更改为“ 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. 感谢chalasr的帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.