<p dir="auto">When adding to a collection of form elements, the collection is empty after calling $form-&gt;createView() on the parent form.</p>
<p dir="auto">I noticed this after switching from 2.2.1 to 2.3.0-RC1.  It could be intended behavior but I haven't noticed any documentation indicating a change.</p>
<p dir="auto">To duplicate the problem, I created a new symfony project via composer create-project for versions 2.2.1 and 2.3.0-RC1.  I then added to the buildForm method in src/DemoBundle/Form/ContactForm.php:</p>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    $builder-&gt;add('foo', 'collection', array('type' =&gt; 'text'));

    for ($i = 0; $i &lt; 5; $i++) {
        $builder-&gt;get('foo')-&gt;add(&quot;bar{$i}&quot;, 'text');
    }"><pre class="notranslate">    <span class="pl-s1"><span class="pl-c1">$</span>builder</span>-&gt;<span class="pl-en">add</span>(<span class="pl-s">'foo'</span>, <span class="pl-s">'collection'</span>, <span class="pl-en">array</span>(<span class="pl-s">'type'</span> =&gt; <span class="pl-s">'text'</span>));

    for (<span class="pl-s1"><span class="pl-c1">$</span>i</span> = <span class="pl-c1">0</span>; <span class="pl-s1"><span class="pl-c1">$</span>i</span> &lt; <span class="pl-c1">5</span>; <span class="pl-s1"><span class="pl-c1">$</span>i</span>++) {
        <span class="pl-s1"><span class="pl-c1">$</span>builder</span>-&gt;<span class="pl-en">get</span>(<span class="pl-s">'foo'</span>)-&gt;<span class="pl-en">add</span>("<span class="pl-s">bar</span>{<span class="pl-s1"><span class="pl-c1">$</span>i</span>}", <span class="pl-s">'text'</span>);
    }</pre></div>
<p dir="auto">In 2.2.1, the form displayed when rendering the /demo/contact url contains the expected 5 text elements.  In 2.3.0, the label for "contact_foo" element is displayed, but none of the sub-elements are displayed.</p>
<p dir="auto">I believe the cause for this something that occurs during the $form-&gt;createView() call.  If you var_dump($form-&gt;get('foo')-&gt;count()) before and after calling createView(), you'll get 5/0, respectively in 2.3.0-RC1, and 5/5 in 2.2.1.  So far I've not been able to determine the exact cause of the problem.  I am using php 5.4.9-4ubuntu2 with the built-in web-server for this test.</p>
<p dir="auto">I am running Symfony 2.7 and I have found that non unique form choice labels are being removed from my choices. I have a choice which shows labels in a parent/child format. e.g:</p>
<ul dir="auto">
<li>Header Nav
<ul dir="auto">
<li>Page 1</li>
<li>Page 2</li>
<li>Page 3</li>
</ul>
</li>
<li>Footer Nav
<ul dir="auto">
<li>Page 1</li>
<li>Page 2</li>
<li>Page 4</li>
</ul>
</li>
</ul>
<p dir="auto">In the above example, "Page 1" and "Page 2" are stripped from the choice because it isn't unique. <strong>However, the actual ID within the choice is different.</strong></p>
<p dir="auto">I have created an example of this from the Symfony Standard repo: <a href="https://github.com/trsteel88/symfony-standard/tree/unique-choices-bug">https://github.com/trsteel88/symfony-standard/tree/unique-choices-bug</a></p>
<p dir="auto">Here is the form:</p>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$form = $this-&gt;createFormBuilder(array())
            -&gt;add('choice', 'choice', array(
                'mapped' =&gt; false,
                'choices' =&gt; array(
                    1 =&gt; 'Header Nav',
                    2 =&gt; ' - Page 1',
                    3 =&gt; ' - Page 2',
                    4 =&gt; ' - Page 3',
                    5 =&gt; 'Footer Nav',
                    6 =&gt; ' - Page 1',
                    7 =&gt; ' - Page 2',
                    8 =&gt; ' - Page 4',
                )
            ))
            -&gt;getForm()
        ;"><pre class="notranslate"><span class="pl-s1"><span class="pl-c1">$</span>form</span> = <span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-&gt;<span class="pl-en">createFormBuilder</span>(<span class="pl-en">array</span>())
            -&gt;<span class="pl-en">add</span>(<span class="pl-s">'choice'</span>, <span class="pl-s">'choice'</span>, <span class="pl-en">array</span>(
                <span class="pl-s">'mapped'</span> =&gt; <span class="pl-c1">false</span>,
                <span class="pl-s">'choices'</span> =&gt; <span class="pl-en">array</span>(
                    <span class="pl-c1">1</span> =&gt; <span class="pl-s">'Header Nav'</span>,
                    <span class="pl-c1">2</span> =&gt; <span class="pl-s">' - Page 1'</span>,
                    <span class="pl-c1">3</span> =&gt; <span class="pl-s">' - Page 2'</span>,
                    <span class="pl-c1">4</span> =&gt; <span class="pl-s">' - Page 3'</span>,
                    <span class="pl-c1">5</span> =&gt; <span class="pl-s">'Footer Nav'</span>,
                    <span class="pl-c1">6</span> =&gt; <span class="pl-s">' - Page 1'</span>,
                    <span class="pl-c1">7</span> =&gt; <span class="pl-s">' - Page 2'</span>,
                    <span class="pl-c1">8</span> =&gt; <span class="pl-s">' - Page 4'</span>,
                )
            ))
            -&gt;<span class="pl-en">getForm</span>()
        ;</pre></div>
<p dir="auto">Here is the output:</p>
<div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;select id=&quot;form_choice&quot; name=&quot;form[choice]&quot;&gt;
   &lt;option value=&quot;1&quot; &gt;Header Nav&lt;/option&gt;
   &lt;option value=&quot;6&quot; &gt; - Page 1&lt;/option&gt;
   &lt;option value=&quot;7&quot; &gt; - Page 2&lt;/option&gt;
   &lt;option value=&quot;4&quot; &gt; - Page 3&lt;/option&gt;
   &lt;option value=&quot;5&quot; &gt;Footer Nav&lt;/option&gt;
   &lt;option value=&quot;8&quot; &gt; - Page 4&lt;/option&gt;
&lt;/select&gt;"><pre class="notranslate"><span class="pl-kos">&lt;</span><span class="pl-ent">select</span> <span class="pl-c1">id</span>="<span class="pl-s">form_choice</span>" <span class="pl-c1">name</span>="<span class="pl-s">form[choice]</span>"<span class="pl-kos">&gt;</span>
   <span class="pl-kos">&lt;</span><span class="pl-ent">option</span> <span class="pl-c1">value</span>="<span class="pl-s">1</span>" <span class="pl-kos">&gt;</span>Header Nav<span class="pl-kos">&lt;/</span><span class="pl-ent">option</span><span class="pl-kos">&gt;</span>
   <span class="pl-kos">&lt;</span><span class="pl-ent">option</span> <span class="pl-c1">value</span>="<span class="pl-s">6</span>" <span class="pl-kos">&gt;</span> - Page 1<span class="pl-kos">&lt;/</span><span class="pl-ent">option</span><span class="pl-kos">&gt;</span>
   <span class="pl-kos">&lt;</span><span class="pl-ent">option</span> <span class="pl-c1">value</span>="<span class="pl-s">7</span>" <span class="pl-kos">&gt;</span> - Page 2<span class="pl-kos">&lt;/</span><span class="pl-ent">option</span><span class="pl-kos">&gt;</span>
   <span class="pl-kos">&lt;</span><span class="pl-ent">option</span> <span class="pl-c1">value</span>="<span class="pl-s">4</span>" <span class="pl-kos">&gt;</span> - Page 3<span class="pl-kos">&lt;/</span><span class="pl-ent">option</span><span class="pl-kos">&gt;</span>
   <span class="pl-kos">&lt;</span><span class="pl-ent">option</span> <span class="pl-c1">value</span>="<span class="pl-s">5</span>" <span class="pl-kos">&gt;</span>Footer Nav<span class="pl-kos">&lt;/</span><span class="pl-ent">option</span><span class="pl-kos">&gt;</span>
   <span class="pl-kos">&lt;</span><span class="pl-ent">option</span> <span class="pl-c1">value</span>="<span class="pl-s">8</span>" <span class="pl-kos">&gt;</span> - Page 4<span class="pl-kos">&lt;/</span><span class="pl-ent">option</span><span class="pl-kos">&gt;</span>
<span class="pl-kos">&lt;/</span><span class="pl-ent">select</span><span class="pl-kos">&gt;</span></pre></div>
<p dir="auto">You will notice that the id for "2" and "3" is now missing, and it has been shifted up and is sitting in the wrong position.</p>