DDC-3582: Nested embeddables are instantiated with the wrong class #4403

Open
opened 2026-01-22 14:41:04 +01:00 by admin · 6 comments
Owner

Originally created by @doctrinebot on GitHub (Feb 22, 2015).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user jankramer:

Consider the example where an entity contains an embeddable, that itself contains 2 different embeddables. So Entity -> Embeddable 1 -> (Embeddable 2, Embeddable 3). In this case, Embeddable1 will be instantiated as an Embeddable2 for some reason.

Please see 5e6b02a0fa for a test that demonstrates this and currently fails.

I looked at the code in the ReflectionEmbeddedProperty, and noticed that 'embeddedClass' was recently changed from 'class'. If I change it back, this test passes, but then the ReflectionEmbeddedPropertyTest fails on the scenario for abstract classes. @ocramius, I saw you were the author on that change, could you please take a look? Thanks!

Originally created by @doctrinebot on GitHub (Feb 22, 2015). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user jankramer: Consider the example where an entity contains an embeddable, that itself contains 2 different embeddables. So Entity -> Embeddable 1 -> (Embeddable 2, Embeddable 3). In this case, Embeddable1 will be instantiated as an Embeddable2 for some reason. Please see https://github.com/jankramer/doctrine2/commit/5e6b02a0fa9a1216b4e4d075061619288af74e7a for a test that demonstrates this and currently fails. I looked at the code in the ReflectionEmbeddedProperty, and noticed that 'embeddedClass' was recently changed from 'class'. If I change it back, this test passes, but then the ReflectionEmbeddedPropertyTest fails on the scenario for abstract classes. @ocramius, I saw you were the author on that change, could you please take a look? Thanks!
admin added the Bug label 2026-01-22 14:41:04 +01:00
Author
Owner

@doctrinebot commented on GitHub (Feb 22, 2015):

Comment created by jankramer:

Closing this as I can't seem to reproduce this issue anymore.

@doctrinebot commented on GitHub (Feb 22, 2015): Comment created by jankramer: Closing this as I can't seem to reproduce this issue anymore.
Author
Owner

@doctrinebot commented on GitHub (Feb 24, 2015):

Comment created by jankramer:

Now able to reproduce this issue, updated the description.

@doctrinebot commented on GitHub (Feb 24, 2015): Comment created by jankramer: Now able to reproduce this issue, updated the description.
Author
Owner

@doctrinebot commented on GitHub (Feb 24, 2015):

Comment created by @ocramius:

[~jankramer] please send a PR with that diff

@doctrinebot commented on GitHub (Feb 24, 2015): Comment created by @ocramius: [~jankramer] please send a PR with that diff
Author
Owner

@doctrinebot commented on GitHub (Feb 24, 2015):

Comment created by jankramer:

@ocramius See https://github.com/doctrine/doctrine2/pull/1311

@doctrinebot commented on GitHub (Feb 24, 2015): Comment created by jankramer: @ocramius See https://github.com/doctrine/doctrine2/pull/1311
Author
Owner

@doctrinebot commented on GitHub (Feb 27, 2015):

Comment created by @doctrinebot:

A related Github Pull-Request [GH-1311] was assigned:
https://github.com/doctrine/doctrine2/pull/1311

@doctrinebot commented on GitHub (Feb 27, 2015): Comment created by @doctrinebot: A related Github Pull-Request [GH-1311] was assigned: https://github.com/doctrine/doctrine2/pull/1311
Author
Owner

@doctrinebot commented on GitHub (Feb 27, 2015):

Comment created by @doctrinebot:

A related Github Pull-Request [GH-1311] was merged:
https://github.com/doctrine/doctrine2/pull/1311

@doctrinebot commented on GitHub (Feb 27, 2015): Comment created by @doctrinebot: A related Github Pull-Request [GH-1311] was merged: https://github.com/doctrine/doctrine2/pull/1311
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4403