mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Composite Key Proxy Entity does not load (Potential Data Loss) #6473
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 @fyrye on GitHub (May 22, 2020).
Bug Report
Summary
Updates
PersistentCollectionwas not related to the issueWhen specifying a composite key entity, the proxy object is never loaded when the entity is retrieved directly from the entity manager prior to outputting the proxy value.
Current behavior
The proxy object is not loaded, resulting in an empty value and a proxy entity object with all
nullproperties.Output
Note:
createdByfor thefoo_bar_a_bentry is emptyProxy Entity Object
How to reproduce
Entity Mappings
Dataset
Code Example
Expected behavior
For the proxy object to be retrieved from the initially retrieved entity, with the following output
Output
Proxy Entity Object
Notes
This is the simplest approach to reproduce the issue I could come up with.
However the Symfony environment, where I discovered the issue, does not allow for easily resolving the issue.Tried retrieving the initial
FooUserusing$em->getReference()and$em->getRepository()->findOneBy()with the same results.Also, the issue no longer persists when enabling
EAGERloading, but due to the amount of records that can be associated in some of the displays,EAGERloading is not desired.When switching the
JoinColumnspositions, the issue appears to be resolved.