mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
[PR #1387] Fix skipping properties if they are listed after a not loaded relation. #9442
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?
Original Pull Request: https://github.com/doctrine/orm/pull/1387
State: closed
Merged: No
This issue fixes an issue that occurs when merging entites, when the entity that is being merged has some other properties after a association type field.
Fixes the following scenario :
Your entity extends a parent entity and when it is merged by the entity manager first its fields are computed, this is done correctly bby
ReflectionPropertiesGetter::getProperties(), but in themergeEntityStateIntoManagedCopymethod the iteration is stopped when it gets to a field that is a relationship and it is Proxy and was not loaded yet.The order in which the fields are computed is : current class properties and then the parent properties, so if the current class has a lazy loaded relationship then the properties of the parent are not merged.
So the fix doesn't stop the iteration it just skips the current property that is not loaded yet and goes to the next property.