You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, in my game form, I add 1 object GameOnConsole. I get the prototype html and replace name by 0. I add another object GameOnConsole so I replace name by 1.
But now, if I delete the first GameOnConsole, my form will have only one GameOnConsole with index : 1.
If this GameOnConsole violates a constraint, the violation will try to reach Object(Symfony\Component\Form\Form).data.gameOnConsoles[0]... which does not exist, because my GameOnConsole has the index 1.
The version of Symfony is 2.5.
I think it is a bug, the validator should use indexes that we passed in the form and not recalculate them.
Thanks !
The text was updated successfully, but these errors were encountered:
the validator uses the index in your Doctrine collection, because it runs on the collection. The issue is that when using adders and removers on the parent object (which is needed to handle relations properly in entities), the index in the collection might not match the index in the form.
Object(Symfony\Component\Form\Form).data.gameOnConsoles[0] exists, as this is a property path in the object itself (.data gets the data of the form).
Hi everybody.
I have a problem with the validation message of my form GameType(). This Type ambed a collection of GameOnConsoleType().
By following the doc : http://symfony.com/doc/current/cookbook/form/form_collections.html, my form works fine except validation messages.
So, in my game form, I add 1 object GameOnConsole. I get the prototype html and replace name by 0. I add another object GameOnConsole so I replace name by 1.
But now, if I delete the first GameOnConsole, my form will have only one GameOnConsole with index : 1.
If this GameOnConsole violates a constraint, the violation will try to reach Object(Symfony\Component\Form\Form).data.gameOnConsoles[0]... which does not exist, because my GameOnConsole has the index 1.
The version of Symfony is 2.5.
I think it is a bug, the validator should use indexes that we passed in the form and not recalculate them.
Thanks !
The text was updated successfully, but these errors were encountered: