Revert "Fix "Array was modified outside object" in ResizeFormListener."
This commit is contained in:
parent
462b7af9b1
commit
f62e30db30
@ -139,21 +139,9 @@ class ResizeFormListener implements EventSubscriberInterface
|
||||
// The data mapper only adds, but does not remove items, so do this
|
||||
// here
|
||||
if ($this->allowDelete) {
|
||||
if ($data instanceof \IteratorAggregate) {
|
||||
$iter = $data->getIterator();
|
||||
while ($iter->valid()) {
|
||||
$name = $iter->key();
|
||||
if ($form->has($name)) {
|
||||
$iter->next();
|
||||
} else {
|
||||
$iter->offsetUnset($name);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
foreach ($data as $name => $child) {
|
||||
if (!$form->has($name)) {
|
||||
unset($data[$name]);
|
||||
}
|
||||
foreach ($data as $name => $child) {
|
||||
if (!$form->has($name)) {
|
||||
unset($data[$name]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user