Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Update deleteAction method in CRUDController #1176

Closed
wants to merge 1 commit into from

3 participants

Vincent Touzet dylan oliver Thomas
Vincent Touzet

Change method from DELETE to POST in deleteAction.

Vincent Touzet vincenttouzet Update Controller/CRUDController.php
Change method from DELETE to POST in deleteAction
7489dea
dylan oliver

Unnecessary, delete and put are still valid if you enable with new static method on Request class (see docs)

Vincent Touzet

Then why not requiring a PUT method for the createAction ?

Thomas
Owner

The issue is only for Symfony2.2. And there is a new static method on the Request object to check if we have to deal with a POST or a PUT.

For now, the master branch is for symfony2.1

Vincent Touzet

Ok so this pull request is not necessary

Thomas
Owner

you can create a PR to handle the case where Request::getHttpMethodParameterOverride is enabled or not on the develop branch.

https://github.com/symfony/symfony/blob/2.2/src/Symfony/Component/HttpFoundation/Request.php#L604-L607

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 16, 2013
  1. Vincent Touzet

    Update Controller/CRUDController.php

    vincenttouzet authored
    Change method from DELETE to POST in deleteAction
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  Controller/CRUDController.php
2  Controller/CRUDController.php
View
@@ -211,7 +211,7 @@ public function deleteAction($id)
throw new AccessDeniedException();
}
- if ($this->getRequest()->getMethod() == 'DELETE') {
+ if ($this->getRequest()->getMethod() == 'POST') {
try {
$this->admin->delete($object);
$this->get('session')->setFlash('sonata_flash_success', 'flash_delete_success');
Something went wrong with that request. Please try again.