Explorar el Código

Fixed a bug when multiple expanded choices would render unchecked because of the Form Framework's strict type checking.

Elnur Abdurrakhimov hace 13 años
padre
commit
6bd1749553

+ 2 - 1
src/Symfony/Bridge/Doctrine/Form/DataTransformer/EntitiesToArrayTransformer.php

@@ -57,7 +57,8 @@ class EntitiesToArrayTransformer implements DataTransformerInterface
             }
         } else {
             foreach ($collection as $entity) {
-                $array[] = current($this->choiceList->getIdentifierValues($entity));
+                $value = current($this->choiceList->getIdentifierValues($entity));
+                $array[] = is_numeric($value) ? (int) $value : $value;
             }
         }