Problem/Motivation

Its possible to nest form element without changing the actual form structure in D8. Sadly this is only supported in Form API and not in Render API, nevertheless there isa huge benefit because the form structure won't change with field group enabled and makes other form alter way more easier.

Proposed resolution

Use #group for forms, keep the nesting logic for entity view modes.

Remaining tasks

User interface changes

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

webflo created an issue. See original summary.

webflo’s picture

FileSize
4.29 KB

Just a WIP patch.

webflo’s picture

FileSize
3.73 KB
webflo’s picture

Status: Active » Needs review

The last submitted patch, 2: 2669904-1.patch, failed testing.

joachim’s picture

Status: Needs review » Needs work

Patch needs a reroll.

webflo’s picture

Status: Needs work » Needs review
FileSize
3.51 KB
webflo’s picture

FileSize
3.51 KB
nils.destoop’s picture

Status: Needs review » Needs work

Tested this patch in combination with field layout module. As this type of grouping will be the fix for #2878359: Field groups are not compatible with field layout. But when applying the patch, and adding a tabs group + tab group, you receive a "Maximum function nesting level of '256' reached, aborting!". The nesting of details is working.

nils.destoop’s picture

Status: Needs work » Closed (works as designed)
nils.destoop’s picture

Status: Closed (works as designed) » Needs work

Re-opening this. I needed to fix field layout support using the old way. Using #groups was working for almost all group types, except vertical tabs. Vertical tabs has his own way of creating groups. The tabs always showed up in the root. Even when they were nested inside other groups.
I'll update with latest version of a patch.

nils.destoop’s picture

Updated patch + screenshots that show remaining issue. You'll see that the vertical tabs is shown as last group, but it should be inside the fieldset

Settings

settings

Result

result

nils.destoop’s picture

Status: Needs work » Closed (duplicate)

On mean while, I tackled this issue. Will be updated in #2878359: Field groups are not compatible with field layout