소스 검색

Fixing issue with FieldGroup and its __clone() method not properly setting the parent.

Jonathan H. Wage 14 년 전
부모
커밋
c1d0262c19
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 2
      src/Symfony/Component/Form/FieldGroup.php

+ 5 - 2
src/Symfony/Component/Form/FieldGroup.php

@@ -57,8 +57,11 @@ class FieldGroup extends Field implements \IteratorAggregate, FieldGroupInterfac
      */
     public function __clone()
     {
-        foreach ($this->fields as $name => $field) {
-            $this->fields[$name] = clone $field;
+        foreach ($this->fields as $name => $field)
+        {
+            $field = clone $field;
+            $field->setParent($this);
+            $this->fields[$name] = $field;
         }
     }