Hi!
If you put some fields in field group, for example horizontal tab, and then hide all fields of this field group for current registration form, empty fieldgroup will be visible
I made a patch for fix problem of this issue. Using hook_field_widget_form_alter () to hide the elements it is not good idea, because in this case, hidden only element widget, but wrapper of element is displayed. Therefore, Drupal displaying empty fieldsets (when all elements widgets of filedset are hidden).
I think we need to move hiding elements operation to hook_form_user_register_form_alter().
Since the need to hide the fields in all forms, not just in user_register_form, I wrote a universal solution. So that's my third version of the patch, I think the final :)
Comments
Comment #2
alex liannoy commentedHello Aleksey,
Could you describe this issue a bit more verbose?
Comment #3
a.sinitsa commentedHi!
If you put some fields in field group, for example horizontal tab, and then hide all fields of this field group for current registration form, empty fieldgroup will be visible
Comment #4
a.sinitsa commentedComment #5
walkingdexter commentedHi!
I made a patch for fix problem of this issue. Using hook_field_widget_form_alter () to hide the elements it is not good idea, because in this case, hidden only element widget, but wrapper of element is displayed. Therefore, Drupal displaying empty fieldsets (when all elements widgets of filedset are hidden).
I think we need to move hiding elements operation to hook_form_user_register_form_alter().
Comment #6
walkingdexter commentedComment #7
walkingdexter commentedI get a mistake in the first version of the patch, so I made the second version.
Comment #8
walkingdexter commentedSince the need to hide the fields in all forms, not just in user_register_form, I wrote a universal solution. So that's my third version of the patch, I think the final :)
Comment #9
omidehghanZD commented@WalkingDexter
have any patches for d7 version of this module? I have same problem and need to this patch for 7.x version . :(
Comment #10
anpolimusImplemented patch in #2802911: Empty fieldsets are still present.
Patch fixes initial problem. If all fields at the field group are disabled - fieldset is gone.
Comment #11
anpolimusComment #13
alex liannoy commentedHi guys,
Thank you for reporting the bug and preparing the patch for it.
Committed the last patch.
Comment #14
alex liannoy commentedComment #16
w01f commentedSeems to still be an issue as of:
Core: 8.6.7
Field Group: 3.x-dev
Multiple Registration: 2.6