This issue relates to the user entity with fields, and fieldgroups.

I have 3 fieldgroups on the user entity type, these are all using the Vertical Tab field type with widget settings "tab open" and "required_fields yes". My issue comes from the fact that I have a very complex registration form (there's a lot of altering going on with the fields, adding additional ones etc) and also the user edit form where I want my fields divided into vertical tabs (hence the settings). I don't have a vertical tab group fieldset, but the tabs render nicely on the edit form anyway. However, on the registration form they are rendered as collapsible tabs (but they look like fieldsets). My issue is that I do indeed want them to look and behave like fieldsets, but I want them to be non-collapsible. I attempted to implement hook_field_group_build_pre_render_alter() and alter the collapsible setting but it didn't seem to work. The code I tried is as follows:

function tpow_user_field_group_build_pre_render_alter(&$element) {
  $element['#fieldgroups']['group_user_profile']->collapsible = FALSE;
  // Also tried this.
  //$element['additional_settings']['group_user_profile']['#collapsible'] = FALSE;
}

I also tried hook_field_group_pre_render_alter(), however this seems to be too late to alter settings.

This seems like a bug to me as the description of hook_field_group_build_pre_render_alter() seems to suggest this sort of thing should be possible. I don't know whether I'm just altering the wrong setting, or missing something altogether, but any help would be much appreciated!

Cheers

Comments

nils.destoop’s picture

This should work by now. Fieldgroup is now using $element['#fieldgroups'] instead of $element['#groups']

nils.destoop’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

pedrosmoker’s picture

i need this on my node form, how can i disable collapsible ?