Revert "Fix "Array was modified outside object" in ResizeFormListener."
This commit is contained in:
parent
462b7af9b1
commit
f62e30db30
@ -139,24 +139,12 @@ class ResizeFormListener implements EventSubscriberInterface
|
|||||||
// The data mapper only adds, but does not remove items, so do this
|
// The data mapper only adds, but does not remove items, so do this
|
||||||
// here
|
// here
|
||||||
if ($this->allowDelete) {
|
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) {
|
foreach ($data as $name => $child) {
|
||||||
if (!$form->has($name)) {
|
if (!$form->has($name)) {
|
||||||
unset($data[$name]);
|
unset($data[$name]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$event->setData($data);
|
$event->setData($data);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user