diff --git a/src/Symfony/Component/Form/Util/PropertyPath.php b/src/Symfony/Component/Form/Util/PropertyPath.php index 482d7ebc62f45..3188fc718ada2 100644 --- a/src/Symfony/Component/Form/Util/PropertyPath.php +++ b/src/Symfony/Component/Form/Util/PropertyPath.php @@ -510,7 +510,7 @@ private function writeProperty(&$objectOrArray, $property, $singular, $isIndex, if (is_array($previousValue) || $previousValue instanceof Traversable) { foreach ($previousValue as $previousItem) { - foreach ($value as $key => $item) { + foreach ($itemsToAdd as $key => $item) { if ($item === $previousItem) { // Item found, don't add unset($itemsToAdd[$key]);