use*_*250 2 php forms doctrine symfony
I'm working on a symfony project which is already live and use doctrine. The problem I describe below is new and I'm certain it was caused by me but I can not confirm this as I'm unsure how to debug.
I have a simple form (it submits two fields) and I can see both these values have been submitted correctly by dumping the following:
$form->handleRequest($request);
Run Code Online (Sandbox Code Playgroud)
The problem is that although I can see the submitted values, the form does not pass validation:
if ($form->isValid() === false)
Run Code Online (Sandbox Code Playgroud)
This used to pass validation, perhaps 4 weeks ago so its something I've done recently.
I have dumped $form->getErrors(true); to see if I can find the error but it returns this:
RenderController.php on line 20:
FormErrorIterator {#685 ?
-form: Form {#691 ?}
-errors: []
}
Run Code Online (Sandbox Code Playgroud)
So unless I'm mistaken, no errors are found here as the errors is empty.
I have read that $form->isValid() checks the data model, i.e. the underlying entity objects.
I have recently made changes to an entity. I did this by first adding a field to the database and then going into the entity class to updating it manually.
Is it possible that I have done something wrong when adding the new field? What confuses me is that are other forms which use the new field and I have not experienced any issues with.
Should I have not done this manually? How do I debug the form further?