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

ObjectHydrator and ArrayHydrator incorrectly hydrate fields of child classes in a JTI when a field name collides #6303

Closed
fullbl opened this issue Feb 24, 2017 · 2 comments
Assignees
Milestone

Comments

@fullbl
Copy link
Contributor

fullbl commented Feb 24, 2017

Hi,

I have an entity named A, which is extended on multi table inheritance by B and C.

Both have a property called $user, which is a simple string on B and a simple_array on C.

If I load the object by query builder with the repository of A and get an object of type B, I could get an empty array, even if I'm expecting a string. This is because AbstractHydrator is setting first non null value from all the joined tabled after translating it into php. Null is converted into array in SimpleArrayType convertToPHPValue function.

An easy solution could be to check for the value to be null BEFORE assigning it, as for #5989

@dengm129
Copy link

#5989

@Ocramius Ocramius added this to the 2.6.0 milestone Aug 19, 2017
Ocramius added a commit that referenced this issue Aug 19, 2017
Ocramius added a commit that referenced this issue Aug 19, 2017
… (which is bullshit), so we use `array` here
Ocramius added a commit that referenced this issue Aug 19, 2017
Ocramius added a commit that referenced this issue Aug 19, 2017
…/JTI require additional information and checks in the hydration process
Ocramius added a commit that referenced this issue Aug 19, 2017
@Ocramius
Copy link
Member

Handled in #6304

@Ocramius Ocramius changed the title ObjectHydrator and ArrayHydrator fail on multiple inheritance with empty simpleArray ObjectHydrator and ArrayHydrator incorrectly hydrate fields of child classes in a JTI when a field name collides Aug 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants