Skip to content

Validation doesn't throw violation to good form in collection form  #11275

Closed
@Sorendil

Description

@Sorendil

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 !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions