I\'ve got a problem with a Symfony2 generated CRUD form. (With MongoDB Documents, but I do not think that this is related)
In my controller\'s createAction() method,
I’ve just got the same problem. For me, the form was not valid, but I could not get any errors by using $form->getErrors() or $form->getErrorsAsString(). I later found I forgot to pass the CSRF token to the form so it won’t be submitted, and $form->handleRequest($request) did nothing (no validation). As I saw @pit's answer, I tried to use
$form->submit($request);
$form->getErrorsAsString();
it returned an error:
ERROR: The CSRF token is invalid. Please try to resubmit the form.
Here is some explanation in the documentation of Symfony2: http://symfony.com/doc/current/book/forms.html#handling-form-submissions