FOSRestBundle
FOSRestBundle copied to clipboard
SF 3.2->3.4 Response 204 regression
Hello,
So we're getting a regression when trying to upgrade to sf 3.4. Once upon a time I had actually tracked down the issue to a change in symfony itself or what this bundle was doing but I've since lost that work but needed to report it. Our tests are failing because instead of receiving a 204 response we're getting a 200.
Here's my controller code
protected function updateCase(Request $request, $objId, $method, $formName, $className)
{
$entityMgr = $this->get('doctrine.orm.entity_manager');
$obj = $entityMgr->getRepository($className)->find($objId);
$form = $this->createForm($formName, $obj, ['method' => $method]);
return ($this->updateObject($request, $entityMgr, $form)) ?
$this->view(null, Response::HTTP_NO_CONTENT) :
$this->view($form, Response::HTTP_BAD_REQUEST);
}
This controller extends the FOSRestController. When I go from sf3.2 our functional tests fail. Thoughts?
Can you create a small example application that allows to reproduce your issue?
do you want a small example or would you be willing to look at the actual app? its on github and has .travis file - its easy to reproduce by changing composer.json to allow sf greater than 3.2...
If there is an existing app that could be easier to set up. Can you share the URL of the git repository?
https://github.com/IBVPD/Nuvi
the src/NS/ApiBundle and related tests is what fails when you change composer.json to allow symfony ^3.2. I'm on IRC and on slack if you want me to help point out what's going wrong and where