<p dir="auto">Hi</p>
<p dir="auto">I have a select box that has to contain the following options. Mention the same label for the options "audi" and "ford".</p>
<div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;select&gt;
  &lt;option value=&quot;volvo&quot;&gt;Volvo&lt;/option&gt;
  &lt;option value=&quot;saab&quot;&gt;Saab&lt;/option&gt;
  &lt;option value=&quot;opel&quot;&gt;Opel&lt;/option&gt;
  &lt;option value=&quot;audi&quot;&gt;Audi&lt;/option&gt;
  &lt;option value=&quot;ford&quot;&gt;Audi&lt;/option&gt;
&lt;/select&gt;"><pre class="notranslate"><span class="pl-kos">&lt;</span><span class="pl-ent">select</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">volvo</span>"<span class="pl-kos">&gt;</span>Volvo<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">saab</span>"<span class="pl-kos">&gt;</span>Saab<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">opel</span>"<span class="pl-kos">&gt;</span>Opel<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">audi</span>"<span class="pl-kos">&gt;</span>Audi<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">ford</span>"<span class="pl-kos">&gt;</span>Audi<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">When I try to render this in Symfony 2.7, my FormType looks like this.</p>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$builder-&gt;add('brand', 'choice', array(
    'choices' =&gt; array(
        'volvo' =&gt; 'Volvo',
        'saab' =&gt; 'Saab',
        'opel' =&gt; 'Opel',
        'audi' =&gt; 'Audi',
        'ford' =&gt; 'Audi'
    )
));"><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">'brand'</span>, <span class="pl-s">'choice'</span>, <span class="pl-en">array</span>(
    <span class="pl-s">'choices'</span> =&gt; <span class="pl-en">array</span>(
        <span class="pl-s">'volvo'</span> =&gt; <span class="pl-s">'Volvo'</span>,
        <span class="pl-s">'saab'</span> =&gt; <span class="pl-s">'Saab'</span>,
        <span class="pl-s">'opel'</span> =&gt; <span class="pl-s">'Opel'</span>,
        <span class="pl-s">'audi'</span> =&gt; <span class="pl-s">'Audi'</span>,
        <span class="pl-s">'ford'</span> =&gt; <span class="pl-s">'Audi'</span>
    )
));</pre></div>
<p dir="auto">I would assume all 5 fields are going to get rendered. In fact, only 4 get rendered and the view looks like this:</p>
<div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;select id=&quot;...&quot;&gt;
   &lt;option value=&quot;volvo&quot;&gt;Volvo&lt;/option&gt;
   &lt;option value=&quot;saab&quot;&gt;Saab&lt;/option&gt;
   &lt;option value=&quot;opel&quot;&gt;Opel&lt;/option&gt;
   &lt;option value=&quot;ford&quot;&gt;Audi&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">...</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">volvo</span>"<span class="pl-kos">&gt;</span>Volvo<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">saab</span>"<span class="pl-kos">&gt;</span>Saab<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">opel</span>"<span class="pl-kos">&gt;</span>Opel<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">ford</span>"<span class="pl-kos">&gt;</span>Audi<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">It seems the option with value "audi" is overriden by the option with value "ford". I don't know if this is standard behaviour or a bug, but it's quite annoying. Can any of you help me?</p>
<p dir="auto">Thanks in advance!</p>
<table role="table">
<thead>
<tr>
<th>Q</th>
<th>A</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bug report?</td>
<td>no</td>
</tr>
<tr>
<td>Feature request?</td>
<td>yes</td>
</tr>
<tr>
<td>BC Break report?</td>
<td>?</td>
</tr>
<tr>
<td>RFC?</td>
<td>?</td>
</tr>
<tr>
<td>Symfony version</td>
<td>3.2.7</td>
</tr>
</tbody>
</table>
<p dir="auto">In the <a href="http://symfony.com/doc/current/form/data_transformers.html#creating-the-transformer" rel="nofollow">documentation for data transformers</a>, the input is validated in the IssueToNumberTransformer class, and the error message is set in the TaskType class. What if there are multiple types of invalid input, can there be a way to have multiple error messages?</p>
<p dir="auto">I know this can be done with Symfony\Component\Validator\Constraints in the Entity class, but since validation must also take place in the data transformer, I think there should be a way to have more control over the error messages.</p>