From 5fd4b68de2c1881ef815dd100f2948a5cf0829be Mon Sep 17 00:00:00 2001 From: Gregor Harlan Date: Thu, 14 Apr 2016 12:10:14 +0200 Subject: [PATCH] fixed ModelType for symfony 3 (#410) --- Form/ChoiceList/PropelChoiceLoader.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Form/ChoiceList/PropelChoiceLoader.php b/Form/ChoiceList/PropelChoiceLoader.php index fc67cb0..47b0f4b 100644 --- a/Form/ChoiceList/PropelChoiceLoader.php +++ b/Form/ChoiceList/PropelChoiceLoader.php @@ -10,6 +10,7 @@ namespace Propel\Bundle\PropelBundle\Form\ChoiceList; +use Propel\Runtime\ActiveQuery\Criteria; use Propel\Runtime\ActiveQuery\ModelCriteria; use Propel\Runtime\ActiveRecord\ActiveRecordInterface; use Propel\Runtime\Map\ColumnMap; @@ -110,7 +111,8 @@ class PropelChoiceLoader implements ChoiceLoaderInterface // Optimize performance in case we have a single-field identifier if (!$this->choiceList && $this->identifierAsIndex && current($this->identifier) instanceof ColumnMap) { $phpName = current($this->identifier)->getPhpName(); - $unorderedObjects = $this->query->filterBy($phpName, $values); + $query = clone $this->query; + $unorderedObjects = $query->filterBy($phpName, $values, Criteria::IN); $objectsById = array(); $objects = array();