Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e1497e7

Browse files
committed
[2.7] [WIP] Fix for #14583
| Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #14583 | License | MIT | Doc PR | Fixes #14583.
1 parent 58efb98 commit e1497e7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ public function loadValuesForChoices(array $choices, $value = null)
134134
*/
135135
public function loadChoicesForValues(array $values, $value = null)
136136
{
137+
// Filters empty values in order to avoid generation of clauses like
138+
// "WHERE id IN ("")
139+
$values = array_diff($values, array(''));
137140
// Performance optimization
138141
// Also prevents the generation of "WHERE id IN ()" queries through the
139142
// object loader. At least with MySQL and on the development machine

0 commit comments

Comments
 (0)