[UserManagementBundle] User form rendered twice when using tabpanes #1142
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Had to figure this one out :) the problem is we have 2 instances of
FormView
, one assigned by default to the template (https://github.com/Kunstmaan/KunstmaanBundlesCMS/blob/master/src/Kunstmaan/UserManagementBundle/Controller/UsersController.php#L197) the other one is generated fromTabPane::getFormView
when needed. Both track their own "am i rendered" state.So we have to ignore one based on
tabPane
being set yes/no, as done with rendering the form itself;https://github.com/Kunstmaan/KunstmaanBundlesCMS/blob/master/src/Kunstmaan/UserManagementBundle/Resources/views/Users/edit.html.twig#L49
Your welcome :) not sure this is also a low-level problem in e.g. the adminbundle itself... Also noticed the event is only triggered for user edit action, not add :( (ref #628)