From f1a38cb4effc7257a3c6ec5cabdd62e820f82a9b Mon Sep 17 00:00:00 2001 From: Javier Spagnoletti Date: Tue, 12 May 2015 11:13:53 -0300 Subject: [PATCH] [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. --- .../Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php index 2335af713128b..b69a2678c7948 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