akeneo / pim-community-dev

[Community Development Repository] The open source Product Information Management (PIM)
http://www.akeneo.com
Other
949 stars 512 forks source link

Can't delete an attribute from a family or attribute group if apc caching is activated #4937

Closed dimitri-koenig closed 7 years ago

dimitri-koenig commented 7 years ago

Akeneo Version: latest 1.5.x

Steps to reproduce:

Frontend Message: The element could not be deleted

Log Message: request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException: "No route found for "POST /configuration/family/8/attribute/113/remove": Method Not Allowed (Allow: DELETE)" at /...../app/cache/prod/classes.php line 2884 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\MethodNotAllowedHttpException: No route found for \"POST /configuration/family/8/attribute/113/remove\": Method Not Allowed (Allow: DELETE) at /...../app/cache/prod/classes.php:2884, Symfony\\Component\\Routing\\Exception\\MethodNotAllowedException: at /...../app/cache/prod/appProdUrlMatcher.php:2339)"} []

request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException: "No route found for "POST /configuration/attribute-group/9/attribute/6/remove": Method Not Allowed (Allow: DELETE)" at /...../app/cache/prod/classes.php line 2884 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\MethodNotAllowedHttpException: No route found for \"POST /configuration/attribute-group/9/attribute/6/remove\": Method Not Allowed (Allow: DELETE) at /...../app/cache/prod/classes.php:2884, Symfony\\Component\\Routing\\Exception\\MethodNotAllowedException: at /...../app/cache/prod/appProdUrlMatcher.php:2339)"} []

Deactivating apc caching solves this problem, but of course has an impact on performance.

solivier commented 7 years ago

Hi @dimitri-koenig,

Thanks for notice that. If you want to use the HttpCache you need to add this line in the app.php file Request::enableHttpMethodParameterOverride();

You can also check this PR as an example: https://github.com/akeneo/pim-community-dev/pull/4945/files

Thanks a lot,

Have a nice day.

dimitri-koenig commented 7 years ago

Thanks, that fixes it.

Why isn't this included in the app.php file, commented/deactivated like all those other caching lines? Any idea?

solivier commented 7 years ago

@dimitri-koenig you're right this line was missing in the app.php file, in fact when we updated from sf2.3 to 2.7 we forgot to update the app.php file.

We will fix this thanks for the feedback.

Have a nice day.