<p dir="auto"><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1867536" data-permission-text="Title is private" data-url="https://github.com/symfony/symfony/issues/2376" data-hovercard-type="issue" data-hovercard-url="/symfony/symfony/issues/2376/hovercard" href="https://github.com/symfony/symfony/issues/2376">#2376</a></p>
<p dir="auto">I'm having this problem and none of the two suggested workarounds worked for me, and I don't know whether it's fixed or not.</p>
<p dir="auto">Symfony2.3</p>
<p dir="auto">Errors are not associated with the field when the indices has a gap.</p>
<p dir="auto">The errors are displayed for both fields.</p>
<div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;input type=&quot;text&quot; id=&quot;post_photos_0_fileName&quot; name=&quot;post[photos][0][fileName]&quot; value=&quot;&quot; /&gt;
&lt;input type=&quot;text&quot; id=&quot;post_photos_1_fileName&quot; name=&quot;post[photos][1][fileName]&quot; value=&quot;&quot; /&gt;"><pre class="notranslate"><span class="pl-kos">&lt;</span><span class="pl-ent">input</span> <span class="pl-c1">type</span>="<span class="pl-s">text</span>" <span class="pl-c1">id</span>="<span class="pl-s">post_photos_0_fileName</span>" <span class="pl-c1">name</span>="<span class="pl-s">post[photos][0][fileName]</span>" <span class="pl-c1">value</span>="" /&gt;
<span class="pl-kos">&lt;</span><span class="pl-ent">input</span> <span class="pl-c1">type</span>="<span class="pl-s">text</span>" <span class="pl-c1">id</span>="<span class="pl-s">post_photos_1_fileName</span>" <span class="pl-c1">name</span>="<span class="pl-s">post[photos][1][fileName]</span>" <span class="pl-c1">value</span>="" /&gt;</pre></div>
<p dir="auto">Errors are only displayed for the first field.</p>
<div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;input type=&quot;text&quot; id=&quot;post_photos_0_fileName&quot; name=&quot;post[photos][0][fileName]&quot; value=&quot;&quot; /&gt;
&lt;input type=&quot;text&quot; id=&quot;post_photos_2_fileName&quot; name=&quot;post[photos][2][fileName]&quot; value=&quot;&quot; /&gt;"><pre class="notranslate"><span class="pl-kos">&lt;</span><span class="pl-ent">input</span> <span class="pl-c1">type</span>="<span class="pl-s">text</span>" <span class="pl-c1">id</span>="<span class="pl-s">post_photos_0_fileName</span>" <span class="pl-c1">name</span>="<span class="pl-s">post[photos][0][fileName]</span>" <span class="pl-c1">value</span>="" /&gt;
<span class="pl-kos">&lt;</span><span class="pl-ent">input</span> <span class="pl-c1">type</span>="<span class="pl-s">text</span>" <span class="pl-c1">id</span>="<span class="pl-s">post_photos_2_fileName</span>" <span class="pl-c1">name</span>="<span class="pl-s">post[photos][2][fileName]</span>" <span class="pl-c1">value</span>="" /&gt;</pre></div>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public function buildForm(FormBuilderInterface $builder, array $options)
{
    $builder-&gt;add(
        'photos',
        'collection',
        array(
            'type'          =&gt; new PhotoType(),
            'allow_add'     =&gt; true,
            'allow_delete'  =&gt; true,
            'prototype'     =&gt; true,
            'by_reference'  =&gt; false
        )

    );
}"><pre class="notranslate"><span class="pl-k">public</span> <span class="pl-k">function</span> <span class="pl-en">buildForm</span>(<span class="pl-smi"><span class="pl-smi">FormBuilderInterface</span></span> <span class="pl-s1"><span class="pl-c1">$</span>builder</span>, <span class="pl-smi">array</span> <span class="pl-s1"><span class="pl-c1">$</span>options</span>)
{
    <span class="pl-s1"><span class="pl-c1">$</span>builder</span>-&gt;<span class="pl-en">add</span>(
        <span class="pl-s">'photos'</span>,
        <span class="pl-s">'collection'</span>,
        <span class="pl-en">array</span>(
            <span class="pl-s">'type'</span>          =&gt; <span class="pl-k">new</span> <span class="pl-v">PhotoType</span>(),
            <span class="pl-s">'allow_add'</span>     =&gt; <span class="pl-c1">true</span>,
            <span class="pl-s">'allow_delete'</span>  =&gt; <span class="pl-c1">true</span>,
            <span class="pl-s">'prototype'</span>     =&gt; <span class="pl-c1">true</span>,
            <span class="pl-s">'by_reference'</span>  =&gt; <span class="pl-c1">false</span>
        )

    );
}</pre></div>