DDC-3699: [GH-1387] Fix skipping properties if they are listed after a not loaded relation. #4541

Closed
opened 2026-01-22 14:44:23 +01:00 by admin · 3 comments
Owner

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 the mergeEntityStateIntoManagedCopy method 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.

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 the `mergeEntityStateIntoManagedCopy` method 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.
admin added the Bug label 2026-01-22 14:44:23 +01:00
admin closed this issue 2026-01-22 14:44:23 +01:00
Author
Owner

@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 (Apr 18, 2015): Comment created by @doctrinebot: A related Github Pull-Request [GH-1387] was labeled: https://github.com/doctrine/doctrine2/pull/1387
Author
Owner

@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): Comment created by @doctrinebot: A related Github Pull-Request [GH-1387] was closed: https://github.com/doctrine/doctrine2/pull/1387
Author
Owner

@doctrinebot commented on GitHub (Jul 15, 2015):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Jul 15, 2015): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4541