mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-3699: [GH-1387] Fix skipping properties if they are listed after a not loaded relation. #4541
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 @doctrinebot on GitHub (Apr 17, 2015).
Originally assigned to: @Ocramius on GitHub.
Jira issue originally created by user @doctrinebot:
This issue is created automatically through a Github pull request on behalf of lenardpalko:
Url: https://github.com/doctrine/doctrine2/pull/1387
Message:
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.
@doctrinebot commented on GitHub (Apr 18, 2015):
Comment created by @doctrinebot:
A related Github Pull-Request [GH-1387] was labeled:
https://github.com/doctrine/doctrine2/pull/1387
@doctrinebot commented on GitHub (Jul 15, 2015):
Comment created by @doctrinebot:
A related Github Pull-Request [GH-1387] was closed:
https://github.com/doctrine/doctrine2/pull/1387
@doctrinebot commented on GitHub (Jul 15, 2015):
Issue was closed with resolution "Fixed"