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

This commit is contained in:
Jonathan H. Wage 2010-09-02 13:51:07 -05:00 committed by Fabien Potencier
parent 0b378d1b3e
commit c1d0262c19

View File

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