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
|
// 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) {
|
foreach ($data as $name => $child) {
|
||||||
$iter = $data->getIterator();
|
if (!$form->has($name)) {
|
||||||
while ($iter->valid()) {
|
unset($data[$name]);
|
||||||
$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]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user