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

[DDC-3582] Wrong class is instantiated when using nested embeddables #1311

Merged
merged 2 commits into from Feb 27, 2015
Merged

[DDC-3582] Wrong class is instantiated when using nested embeddables #1311

merged 2 commits into from Feb 27, 2015

Conversation

jankramer
Copy link

Consider a nested embeddable hierarchy: Entity > Embeddable 1 > Embeddable 2. In this case, when fetching an entity from the database, Embeddable 1 will be instantiated as an instance of Embeddable 2.

This is because the wrong class name is passed as embeddedClass to the constructor of ReflectionEmbeddedProperty from the ClassMetadataInfo::wakeupReflection method. This PR fixes this.

@doctrinebot
Copy link

Hello,

thank you for creating this pull request. I have automatically opened an issue
on our Jira Bug Tracker for you. See the issue link:

http://www.doctrine-project.org/jira/browse/DDC-3585

We use Jira to track the state of pull requests and the versions they got
included in.

@jankramer
Copy link
Author

@Ocramius Could you please take a look at the proposed fix? I'm not entirely confident this is the best solution as I'm not very familiar with the reflection properties.

@guilhermeblanco
Copy link
Member

👍

@guilhermeblanco guilhermeblanco self-assigned this Feb 27, 2015
guilhermeblanco added a commit that referenced this pull request Feb 27, 2015
…dration

[DDC-3582] Wrong class is instantiated when using nested embeddables
@guilhermeblanco guilhermeblanco merged commit 6e40361 into doctrine:master Feb 27, 2015
@Ocramius
Copy link
Member

Note: the test should be ported into the actual test class for embeddables :-\

@guilhermeblanco
Copy link
Member

@Ocramius considering as a ticket issue, it's ok to have DDC models. It's an optimization for the test suite... not really bound to the issue per se, that's why I consider it valid.

@Ocramius
Copy link
Member

Yes, I'll just have to move the tests around when I have time.

I just want to reduce the spread of tests around different paths/naming conventions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants