Skip to content

Conversation

@MatTheCat
Copy link
Contributor

@MatTheCat MatTheCat commented Jul 4, 2024

Q A
Bug fix? yes
New feature? no
Issues N/A
License MIT

This PR fixes two issues (tests included) with the DoctrineEntityHydrationExtension:

  • Entities with composite IDs couldn’t be hydrated because in this case the object manager needs the properties as keys. Throwing if the 0 key does not exist prevents this to work, so this PR removes this check.
  • Dehydrated entities whose ID is a foreign key would bear the corresponding entity (or proxy), preventing their future correct hydration. This PR dehydrates ID values as well if needed.

@carsonbot carsonbot added Bug Bug Fix LiveComponent Status: Needs Review Needs to be reviewed labels Jul 4, 2024
@carsonbot carsonbot added Status: Reviewed Has been reviewed by a maintainer and removed Status: Needs Review Needs to be reviewed labels Jul 5, 2024
@kbond
Copy link
Member

kbond commented Jul 5, 2024

This is great, thanks Mathieu!

@kbond kbond merged commit d0bb978 into symfony:2.x Jul 5, 2024
@MatTheCat MatTheCat deleted the doctrine_entity_hydration branch July 5, 2024 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Bug Fix LiveComponent Status: Reviewed Has been reviewed by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants