fixed issue with clone now the children of the original form are preserved and the clone form is given new children
This commit is contained in:
parent
61dd06ea27
commit
b952bcbf9a
@ -170,6 +170,8 @@ class Form implements \IteratorAggregate, FormInterface
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->children = clone $this->children;
|
||||
|
||||
foreach ($this->children as $key => $child) {
|
||||
$this->children[$key] = clone $child;
|
||||
}
|
||||
|
@ -141,6 +141,7 @@ class CompoundFormTest extends AbstractFormTest
|
||||
|
||||
$this->assertNotSame($this->form, $clone);
|
||||
$this->assertNotSame($child, $clone['child']);
|
||||
$this->assertNotSame($this->form['child'], $clone['child']);
|
||||
}
|
||||
|
||||
public function testNotEmptyIfChildNotEmpty()
|
||||
|
Reference in New Issue
Block a user