diff --git a/Util/PropertyPath.php b/Util/PropertyPath.php index 482d7ebc62..3188fc718a 100644 --- a/Util/PropertyPath.php +++ b/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]);