diff --git a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php index 2335af713128..b69a2678c794 100644 --- a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php +++ b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php @@ -134,6 +134,9 @@ public function loadValuesForChoices(array $choices, $value = null) */ public function loadChoicesForValues(array $values, $value = null) { + // Filters empty values in order to avoid generation of clauses like + // "WHERE id IN ('')" + $values = array_diff($values, array('')); // Performance optimization // Also prevents the generation of "WHERE id IN ()" queries through the // object loader. At least with MySQL and on the development machine