Fixes #5755 - Parent class fields are not cloned#5768
Closed
edhgoose wants to merge 1 commit into
Closed
Conversation
…>getReflectionClass()->getProperties()' to ensure all fields are copied, and adds test to confirm behaviour
Ocramius
added a commit
that referenced
this pull request
Sep 10, 2016
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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) {.