简体   繁体   English

奏鸣曲管理员/媒体冲突(CRUDController)

[英]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.

相关问题 管理员的Sonata媒体验证 - Sonata media validation at admin 奏鸣曲管理员列表可编辑与编辑/显示冲突 - Sonata admin list editable conflict with edit / show Sonata管理员在“模板”和“可编辑”之间发生冲突 - Sonata Admin conflict between 'template' and 'editable' 带有 Sonata Admin Bundle 3.0(或 2.4)的 Sonata Media Bundle - Sonata Media Bundle with Sonata Admin Bundle 3.0 (or 2.4) 在Sonata Admin中的实体中包括媒体类型 - Include a media type in an Entity from Sonata Admin 如何从URL @admin_sonata_media_media_create的sonata_type_model_list中删除类别 - How to remove category from sonata_type_model_list at url @admin_sonata_media_media_create Symfony 4.4 的奏鸣曲管理员无法安装树枝/树枝冲突 - Sonata Admin for Symfony 4.4 not possible install twig/twig conflict Symfony 2 Sonata Media捆绑包:保存媒体文件图像而无需Sonata管理员 - Symfony 2 Sonata Media bundle: saving media file image without sonata admin Sonata管理员捆绑预览图像来自列表映射器中的某个实体,没有奏鸣曲媒体包 - Sonata admin bundle preview image from some entity in list mapper without sonata media bundle 有没有办法从 Sonata Media Bundle 的管理界面中选择性地修剪媒体提供者? - Is there a way to selectively prune media providers from an admin interface in Sonata Media Bundle?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM