[PR #6771] Not all fields are present when getting the original data for an entity. #10134

Open
opened 2026-01-22 16:06:32 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/6771

State: closed
Merged: No


In some cases not all fields are present in the array returned by UnitOfWork::getOriginalEntityData(). It will filter out non-owning association when updating a scalar field.

Is this intended behavior?

See the PR unit test for a test case. I would expect the keys to be the same in both cases but this is not true. My guess it because of this continue in the UoW.

Result of the added test case:

1) Doctrine\Tests\ORM\Functional\Ticket\UnknownTicketTest::testCompleteOriginalData
Failed asserting that Array &0 (
    0 => 'name'
) is identical to Array &0 (
    0 => 'name'
    1 => 'tweets'
    2 => 'userLists'
    3 => 'id'
).
**Original Pull Request:** https://github.com/doctrine/orm/pull/6771 **State:** closed **Merged:** No --- In some cases not all fields are present in the array returned by `UnitOfWork::getOriginalEntityData()`. It will filter out non-owning association when updating a scalar field. Is this intended behavior? See the PR unit test for a test case. I would expect the keys to be the same in both cases but this is not true. My guess it because of [this `continue` in the UoW](https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/UnitOfWork.php#L625). Result of the added test case: ``` 1) Doctrine\Tests\ORM\Functional\Ticket\UnknownTicketTest::testCompleteOriginalData Failed asserting that Array &0 ( 0 => 'name' ) is identical to Array &0 ( 0 => 'name' 1 => 'tweets' 2 => 'userLists' 3 => 'id' ). ```
admin added the pull-request label 2026-01-22 16:06:32 +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#10134