-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix attribute ManyToMany mapping #10671
Fix attribute ManyToMany mapping #10671
Conversation
Can you please write a test for this, based on one of the examples mentioned in the issue you fix? |
61be776
to
4c320a7
Compare
@greg0ire done |
4c320a7
to
2f95c4d
Compare
tests/Doctrine/Tests/ORM/Mapping/Fixtures/AttributeEntityWithNestedJoinColumns.php
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested locally, and the both assertions fail without your changes 👍
Please improve your commit message according to our contributing guide
Right now, one has to read the code and tests to realize what's broken and how you fix it.
2f95c4d
to
436ce8b
Compare
|
||
foreach ($joinTableAttribute->inverseJoinColumns as $joinColumn) { | ||
$joinTable['inverseJoinColumns'][] = $this->joinColumnToArray($joinColumn); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've looked into the issue, and it looks like there is a piece of code that is just missing from this new implementation. I don't know why it was done like that, but your commit message could look like this:
Take into account join columns specifications.
Currently, the AttributeDriver ignores any join column attribute
specified on a many to many relationship.
Let's copy code from the AnnotationDriver to fix that.
Fixes #9902
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was missing because php 8.0 does not support nested attributes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah great! That explains it fully!
Currently, the AttributeDriver ignores any join column attribute specified on a many to many relationship. Let's copy code from the AnnotationDriver to fix that. Fixes doctrine#9902
436ce8b
to
2af6e4d
Compare
Thanks @BoShurik ! |
Fixes #9902