Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#12 | grouping-settings.png | 315.79 KB | nils.destoop |
#12 | grouping-result.png | 133.21 KB | nils.destoop |
#12 | grouping-2669904-11.patch | 12.11 KB | nils.destoop |
#8 | 2669904-8.patch | 3.51 KB | webflo |
#7 | 2669904-7.patch | 3.51 KB | webflo |
Comments
Comment #2
webflo CreditAttribution: webflo at UEBERBIT GmbH commentedJust a WIP patch.
Comment #3
webflo CreditAttribution: webflo at UEBERBIT GmbH commentedComment #4
webflo CreditAttribution: webflo at UEBERBIT GmbH commentedComment #6
joachim CreditAttribution: joachim as a volunteer commentedPatch needs a reroll.
Comment #7
webflo CreditAttribution: webflo at UEBERBIT GmbH commentedComment #8
webflo CreditAttribution: webflo at UEBERBIT GmbH commentedComment #9
nils.destoop CreditAttribution: nils.destoop as a volunteer and at Wunder commentedTested 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.
Comment #10
nils.destoop CreditAttribution: nils.destoop as a volunteer and at Wunder commentedClosing this one in favor of #2878359: Field groups are not compatible with field layout
Comment #11
nils.destoop CreditAttribution: nils.destoop as a volunteer and at Wunder commentedRe-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.
Comment #12
nils.destoop CreditAttribution: nils.destoop as a volunteer and at Wunder commentedUpdated 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
Result
Comment #13
nils.destoop CreditAttribution: nils.destoop as a volunteer and at Wunder commentedOn mean while, I tackled this issue. Will be updated in #2878359: Field groups are not compatible with field layout