mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Duplicate objects in collection of nested objects with multiple references #6945
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @klammbueddel on GitHub (Mar 10, 2022).
Bug Report
Given 3 classes, a
Containercontaining a list ofItems and each item containing multipleParts, if the container references both, the complete list of items ($container->items) and points to one item in the list ($container->currentItem), the parts of the item will be duplicated in the result set if fetched via DQL.As a sidenote, the issue does not occur if the objects are already managed (see
testIfAlreadyManagedin #9580).How to reproduce
Expected behavior
The
$item->partsshould not contain duplicates.@klammbueddel commented on GitHub (Mar 17, 2022):
Hi,
would be great if somebody could review the PR.
Thanks ;)