-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 nested admin (one-to-one-to-many relation) that opens inline (fixes #6777) #6778
Conversation
tests will fail, because I have no idea how do you mock methods that does not exist on interface (talking about |
? |
890548e
to
48eec3b
Compare
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.
Can you add a test where hasFormFieldDescription return false ?
There isnone case that I dont know how to handle. if ($collection instanceof DoctrinePersistentCollection || $collection instanceof PersistentCollection) {
//since doctrine 2.4
$modelClassName = $collection->getTypeClass()->getName();
} elseif ($collection instanceof Collection) {
$modelClassName = $this->getEntityClassName($admin, explode('.', preg_replace('#\[\d*?\]#', '', $path)));
} else {
throw new \Exception('unknown collection class');
} I can check for exception. But how should I handle case with |
I find the code
weird, since a PersistentCollection is a Collection, we should be able to remove the if part. the collection is
So you could mock the propertyAccessor. |
f33a01a
to
06715e9
Compare
Rebasing 3.x should fix the build |
06715e9
to
a6a8735
Compare
72f567c
to
a066775
Compare
some why on my local machine - ), \E_USER_DEPRECATED);
+ ), E_USER_DEPRECATED); I don't really understand why |
Can you try |
Any way, I hope that it's been final fixes of this branch, other way I'll fix it some how |
Could you please use the PR template in order to expose the motivation for these changes in the "Changelog" section? |
- remove useless if branch (and some lines in phpstan baseline because of this) - cover all cases of this method - early fail if no collection. Also add better description to the exception
a066775
to
612830b
Compare
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.
If this PR is fixing something, the "Changelog" section should include the "Fixed" item.
Thank you |
Subject
Fix form rendering of nested Admin properties.
I am targeting this branch, because everything is backwards compatible.
Closes #6777.
Changelog