Skip to content

[Tree] Fix TreeObjectHydrator compatibility with ORM 3#3041

Open
PhilDaiguille wants to merge 1 commit intodoctrine-extensions:mainfrom
PhilDaiguille:fix/tree-object-hydrator-orm3
Open

[Tree] Fix TreeObjectHydrator compatibility with ORM 3#3041
PhilDaiguille wants to merge 1 commit intodoctrine-extensions:mainfrom
PhilDaiguille:fix/tree-object-hydrator-orm3

Conversation

@PhilDaiguille
Copy link
Copy Markdown

@PhilDaiguille PhilDaiguille commented Mar 9, 2026

Hello ! Fix bug in issue : #2921
This pull request fixes a compatibility issue in the TreeObjectHydrator with ORM 3 when the parent property is defined before the children property in an entity. It also adds a new test fixture and test case to ensure this scenario is properly handled.

Bug fix for ORM 3 compatibility:

  • Updated TreeObjectHydrator to correctly handle association mappings whether they are arrays or objects, ensuring the hydrator works when the parent property is defined before the children property in tree entities.
  • Added a changelog entry describing the fix for TreeObjectHydrator compatibility with ORM 3.

Testing improvements:

  • Added a new fixture entity RootCategoryReversed with the parent property defined before children, to test the fixed scenario.
  • Registered RootCategoryReversed in the test suite and added a test case testFullTreeHydrationWithReversedFieldOrder to verify correct tree hydration when field order is reversed. [1] [2] [3]

@PhilDaiguille PhilDaiguille force-pushed the fix/tree-object-hydrator-orm3 branch 2 times, most recently from c437c35 to 4a559b0 Compare March 9, 2026 21:53
@PhilDaiguille PhilDaiguille force-pushed the fix/tree-object-hydrator-orm3 branch from 4a559b0 to 0e61da2 Compare March 9, 2026 21:54
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.

1 participant