[PR #1387] Fix skipping properties if they are listed after a not loaded relation. #9442

Closed
opened 2026-01-22 16:04:20 +01:00 by admin · 0 comments
Owner

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 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.

**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 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 pull-request label 2026-01-22 16:04:20 +01:00
admin closed this issue 2026-01-22 16:04:20 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#9442