Sonata Admin Bundle 删除在 prod 中不起作用 [英] Sonata Admin Bundle delete not working in prod

查看:26
本文介绍了Sonata Admin Bundle 删除在 prod 中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下问题:如果我在确认屏幕后尝试在 prod 环境中删除奏鸣曲管理中的某些内容并按是,删除",则不会发生任何事情.在开发中一切正常.会不会是缓存问题?我可以尝试任何设置吗?

I have a following issue: if I try to delete something in sonata admin in prod enviroment after confirmation screen and pressing "yes, delete" nothing happens. In dev everything works fine. Could it be a caching issue? Any settings I could try?

推荐答案

问题出在检测请求方法的代码中.它应该检测 DELETE 方法,但它将所有删除操作检测为 POST 方法.

The problem is in the code that detecting the request method. It should detect DELETE method but it detects all delete operations as POST method instead.

在你的 app.php 中添加这行代码来解决这个问题:

Add this line of code in your app.php to fix this:

Request::enableHttpMethodParameterOverride();

它可以在 $request = Request::createFromGlobals(); 之后

it can be after $request = Request::createFromGlobals();

这篇关于Sonata Admin Bundle 删除在 prod 中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆