I have got strange problem with handleRequest method in Symfony 2.3.5.
I am submitting form with handleRequest ($editForm->handleRequest($request)) and everything is working fine on dev. But on prod environment it is not working. I have debug everything and I found that it is not submitting this form.
I have managed to get this working with changing
$editForm->handleRequest($request)
to
$editForm->submit($request->request->get($editForm->getName()))
But could someone tell me why handleRequest is not working for me just in prod environment?
I have removed all cache.
EDIT: I have also remind myself that it is working great on creating, but not on editing/updating.
Are you setting the method param when creating your $editForm?
$editForm = $this->createForm(new TaskType(), $task, array(
'action' => $this->generateUrl('edit_task'),
'method' => 'PUT',
));
$editForm->handleRequest($request);
Additionally you might need to set http_method_override
in your config. http://symfony.com/doc/current/reference/configuration/framework.html#http-method-override
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With