瀏覽代碼

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

Elnur Abdurrakhimov 13 年之前
父節點
當前提交
6bd1749553
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/Symfony/Bridge/Doctrine/Form/DataTransformer/EntitiesToArrayTransformer.php

+ 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;
             }
         }