Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #5755 - Parent class fields are not cloned #5768

Closed

Conversation

edhgoose
Copy link
Contributor

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 Ocramius@8272ffd#diff-b8508327ba460ef291cee00db8cb7b23L432, which used foreach ($class->reflFields as $field => $reflProperty) {.

…>getReflectionClass()->getProperties()' to ensure all fields are copied, and adds test to confirm behaviour
@Ocramius Ocramius added this to the 2.5.5 milestone Apr 12, 2016
@Ocramius Ocramius self-assigned this Apr 12, 2016
Ocramius added a commit that referenced this pull request Sep 10, 2016
@Ocramius Ocramius closed this in cd11723 Sep 10, 2016
Ocramius added a commit that referenced this pull request Sep 10, 2016
@Ocramius
Copy link
Member

Merged, thanks!

master: cd11723
2.5: 73e4be7

@betd-claumond
Copy link

@edhgoose Thanks for this fix !
@Ocramius Is it possible to backport this fix to 2.4 please ?

yvoyer pushed a commit to yvoyer/doctrine2 that referenced this pull request Nov 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants