When using HasMany field and validation fails somewhere in the Form, it resets new items index to zero always, so if you try to add new Item on the second attempt, you will have to HasMany items with key new_1, which will override one another without any warnings.
Steps To Reproduce:
Create form with HasMany field.
Make some fields of the main Instance required and not fill them. Add one Item to HasMany field, fill its inputs.
Submit the From. See errors.
Add another Item to HasMany field. Submit the form again (so that error happens or not).
See that you now have only one Item in your HasMany field list (the last one of two).
Description:
When using HasMany field and validation fails somewhere in the Form, it resets new items index to zero always, so if you try to add new Item on the second attempt, you will have to HasMany items with key
new_1
, which will override one another without any warnings.Steps To Reproduce:
And all this even assuming you have followed the instruction described in this issue, regarding wrong key mapping in the HasMany field after validation fails. Without it you will see your HasMany Items disappearing on every form submit.