-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
Form element of inverse side of a bidirectional association is always removed #741
Comments
Would detaching the handleExcludeAssociation do the job you're asking for?
|
Yes it should, but if I'm not wrong then unidirectional associations will get the element included too. The common case is a composed form that has a bidirectional association and also contains another association that is unidirectional. If i remove the listener then both association will be included instead of just one. In case of single form generation: removing, generating a form, re-adding workflow also looks a bit cumbersome to me. I.e. IMHO the solution should be specific and not global. There should be a way to specify to not exclude an association (that is correctly excluded by default). |
I agree a specific solution is in order. So there are two options.
I much prefer 2 |
Dear Tom, not sure I get the point of you "answer". I reported a use case that is not covered by the library and also a use case where detaching the listener would not work and has no reasonable workaround. Hence, to me, the request to support form generation of bidirectional associations look reasonable and not a corner case of my specific implementation. To sum up the current status of the library:
Do we agree on this or I am misunderstanding something? |
This issue requires a lot of framework to duplicate the issue. I would appreciate it if you'd provide a working application that duplicates this issue. |
When a form is built from annotations (or attributes) if the form has an element that is an association, the element is removed from the form if it is on the inverse side of the association.
In case of a truly bidirectional (many-to-many) association implemented with best practices as suggested in https://gist.github.com/Ocramius/3121916 one might want to have forms generated from annotations (or attributes) to have the associated element on both sides i.e. also on the inverse side.
Currently
EntityBasedFormBuilder
checks to exclude an element here that triggershandleExcludeAssociation
and this just checks if the element is the inverse side, and in that case, as a consequence, removes the element from the$formSpec
.This should be configurable, maybe with an appropriate annotation, ending up in the $metadata, that can be checked in the
handleExcludeAssociation()
.The annotation can be something like "bidirectional", to not mix the term with words like 'required', 'force' or 'keep'.
The text was updated successfully, but these errors were encountered: