FOSRestBundle icon indicating copy to clipboard operation
FOSRestBundle copied to clipboard

SF 3.2->3.4 Response 204 regression

Open gnat42 opened this issue 6 years ago • 4 comments

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?

gnat42 avatar May 01 '18 17:05 gnat42

Can you create a small example application that allows to reproduce your issue?

xabbuh avatar May 03 '18 09:05 xabbuh

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...

gnat42 avatar May 03 '18 21:05 gnat42

If there is an existing app that could be easier to set up. Can you share the URL of the git repository?

xabbuh avatar May 03 '18 22:05 xabbuh

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

gnat42 avatar May 03 '18 22:05 gnat42