[PR #5768] Fixes #5755 - Parent class fields are not cloned #9717

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

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

State: closed
Merged: No


This addresses #5755, which we have also just noticed as a result of upgrading from Symfony 2.3 to 2.8. The bug is that private/protected fields in a parent class are not cloned when cloning a proxy.

The relevant changes and what we're reversing are here:

https://github.com/doctrine/common/pull/168/files#diff-4415e2672350448f02229f989bcfca38R85 This is the original commit to migrate the clone functionality into Doctrine common. Note the use of foreach ($metadata->getReflectionClass()->getProperties() as $reflProperty) {.

The change this replaces is in https://github.com/Ocramius/doctrine2/commit/8272ffd23fd66bac13a0dc074c868a00b82c7707#diff-b8508327ba460ef291cee00db8cb7b23L432, which used foreach ($class->reflFields as $field => $reflProperty) {.

**Original Pull Request:** https://github.com/doctrine/orm/pull/5768 **State:** closed **Merged:** No --- This addresses #5755, which we have also just noticed as a result of upgrading from Symfony 2.3 to 2.8. The bug is that private/protected fields in a parent class are not cloned when cloning a proxy. The relevant changes and what we're reversing are here: https://github.com/doctrine/common/pull/168/files#diff-4415e2672350448f02229f989bcfca38R85 This is the original commit to migrate the clone functionality into Doctrine common. Note the use of `foreach ($metadata->getReflectionClass()->getProperties() as $reflProperty) {`. The change this replaces is in https://github.com/Ocramius/doctrine2/commit/8272ffd23fd66bac13a0dc074c868a00b82c7707#diff-b8508327ba460ef291cee00db8cb7b23L432, which used `foreach ($class->reflFields as $field => $reflProperty) {`.
admin added the pull-request label 2026-01-22 16:05:12 +01:00
admin closed this issue 2026-01-22 16:05:13 +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#9717