<ol dir="auto">
<li>First bug found when displaying errors in collection. When numeration of (<strong>name</strong>) does not start from zero validation errors are displayed in bad collection memebers. For example:<br>
a) I add 3 new collection members<br>
b) I remove first member<br>
c) I submit a form (got validation errors)<br>
d) I add 1 new member<br>
e) I submit form again<br>
f) Validation errors are displayed in bad members, Last member does not have validation errors. First elemet has errors no matter if it is valid or not.</li>
<li>There is a bug in algorithm in documentation (<a href="http://symfony.com/doc/current/cookbook/form/form_collections.html" rel="nofollow">http://symfony.com/doc/current/cookbook/form/form_collections.html</a>), when you remove some elements from the middle of collection, and then submit form, after page is reloaded you will get bad (<strong>name</strong>) numeration when add new tags i.e. input names will have same <strong>name</strong> value.</li>
</ol>
<p dir="auto">I am coding a project along the lines of the cookbook entry on embedded collections as stated on: <a href="http://symfony.com/doc/current/cookbook/form/form_collections.html" rel="nofollow">http://symfony.com/doc/current/cookbook/form/form_collections.html</a>.</p>
<p dir="auto">I am considering the following use case:</p>
<ol dir="auto">
<li>Starting out with entering a new entity task, tag is the embedded collection</li>
<li>I click the Javascript 'add a tag'-link, which adds a bar 0 instance of the tag form</li>
<li>I click the Javascript 'add a tag'-link, which adds a bar 1 instance of the tag form</li>
<li>I click the Javascript 'add a tag'-link, which adds a bar 2 instance of the tag form</li>
<li>I click the Javascript 'delete this tag'-link for tag(1), which leaves me with the instances 0 and 2</li>
</ol>
<p dir="auto">Now, if I would leave all these tags blank (with a notblank validation on the tag name attribute), the returned form would be expected to visualize the error statements on instances 0 and 2. However, it turns out that the feedback is only displayed for instance 0.</p>
<p dir="auto">If I change the returned form with firebug and set the instances on the name input field of instance 2 to '1', the feedback is displayed on the correct instance. This behavior indicates a mismatch between the indexing of the embedded form instances and the validators.</p>