<table role="table">
<thead>
<tr>
<th>Q</th>
<th>A</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bug report?</td>
<td>yes</td>
</tr>
<tr>
<td>Feature request?</td>
<td>no</td>
</tr>
<tr>
<td>BC Break report?</td>
<td>no</td>
</tr>
<tr>
<td>RFC?</td>
<td>no</td>
</tr>
<tr>
<td>Symfony version</td>
<td>2.8.*</td>
</tr>
</tbody>
</table>
<p dir="auto">No validation violation occurs on invalid values in EntityType.</p>
<p dir="auto">This seems to be because EntityType uses ORMQueryBuilderLoader, and it's getEntitiesByIds does not validate that the number of inputs matches the number of outputs. It only does an SQL WHERE IN (provided IDs) query to get whatever values are valid.</p>
<p dir="auto">To replicate - add an entity in the form type on the form, then either manually delete the entity in the database before submitting, or manipulate the request (POST) data to have invalid values on submit. The invalid values just drop, the valid values remain, and no validation error is raised.</p>
<p dir="auto">I'm breaking this out from <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="128108229" data-permission-text="Title is private" data-url="https://github.com/symfony/symfony/issues/17488" data-hovercard-type="issue" data-hovercard-url="/symfony/symfony/issues/17488/hovercard" href="https://github.com/symfony/symfony/issues/17488">#17488</a> as that ticket is specifically addressing that it causes exceptions when using PostgreSQL; however, the bigger issue is that invalid values don't raise any validation.</p>
<p dir="auto">This is not easy to workaround because $queryBuilder in ORMQueryBuilderLoader is private rather than protected, so the variable and every method in the class needs to be duplicated.</p>
<p dir="auto">Working through some tests using the bundled Security functionality, and we have noticed that on a logout action we are getting in our server logs:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[Mon Oct 29 16:43:14 2012] [error] [client xxx.xxx.xxx.xxx] PHP Fatal error:  Uncaught exception 'ErrorException' with message 'Warning: SessionHandler::write(): Parent session handler is not open in /web_dir/app/cache/dev/classes.php line 558' in /web_dir/app/cache/dev/classes.php:558\nStack trace:\n#0 [internal function]: Symfony\\Component\\HttpKernel\\Debug\\ErrorHandler-&gt;handle(2, 'SessionHandler:...', '/web_dir...', 558, Array)\n#1 /web_dir/app/cache/dev/classes.php(558): SessionHandler-&gt;write('e0ua5bnj0vneq97...', '_sf2_attributes...')\n#2 [internal function]: Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\SessionHandlerProxy-&gt;write('e0ua5bnj0vneq97...', '_sf2_attributes...')\n#3 [internal function]: session_write_close()\n#4 {main}\n  thrown in /web_dir/app/cache/dev/classes.php on line 558"><pre class="notranslate"><code class="notranslate">[Mon Oct 29 16:43:14 2012] [error] [client xxx.xxx.xxx.xxx] PHP Fatal error:  Uncaught exception 'ErrorException' with message 'Warning: SessionHandler::write(): Parent session handler is not open in /web_dir/app/cache/dev/classes.php line 558' in /web_dir/app/cache/dev/classes.php:558\nStack trace:\n#0 [internal function]: Symfony\\Component\\HttpKernel\\Debug\\ErrorHandler-&gt;handle(2, 'SessionHandler:...', '/web_dir...', 558, Array)\n#1 /web_dir/app/cache/dev/classes.php(558): SessionHandler-&gt;write('e0ua5bnj0vneq97...', '_sf2_attributes...')\n#2 [internal function]: Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\SessionHandlerProxy-&gt;write('e0ua5bnj0vneq97...', '_sf2_attributes...')\n#3 [internal function]: session_write_close()\n#4 {main}\n  thrown in /web_dir/app/cache/dev/classes.php on line 558
</code></pre></div>
<p dir="auto">It seems this issue isn't unique to us as seen at:</p>
<p dir="auto"><a href="https://groups.google.com/forum/?fromgroups=#!topic/symfony-devs/Q-f0lKT7OZ8" rel="nofollow">https://groups.google.com/forum/?fromgroups=#!topic/symfony-devs/Q-f0lKT7OZ8</a></p>
<p dir="auto">We are running a centos 6 machine running <strong>PHP v5.4.7</strong> and <strong>Apache/2.2.15</strong>.</p>
<p dir="auto">Anyone have any suggestions as to what is causing this and how we can eliminate this message on every log out?</p>