Problem/Motivation
In #3306820: Show machine name in "Manage form display" and "Manage display" table row, Drupal core is adding a "Machine name" column.
When I apply this patch for core (or use the latest version), while field_group is enabled, the table looks broken, because in the field group table rows, content ends up in the wrong table cell.
We should support this additional column with field_group, possibly as a conditional feature, to support different versions of core.
Steps to reproduce
Use current Drupal from before the change.
Install field group.
Create some content displays that use field groups.
Upgrade to latest 11.x (possibly soon 10.4.x?), or patch it with 3306820.
Check "Manage display".
Play with "Show row weights" and "Hide row weights".
Expected:
- Table cells in field group rows are aligned with the cells for field rows.
- The machine names do show up.
- The "Show row weights" and "Hide row weights" works correctly.
Actual:
- Table cells are misaligned.
- The machine names are hidden if "Hide row weights" is used. They show up if "Show row weights" is used.
(not sure if it will always be like this but at least it won't work correctly I think)
Proposed resolution
Conditionally add the additional column / cell in the rows added by field_group.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | field_group-3471822-machine-name-column.patch | 564 bytes | donquixote |
Issue fork field_group-3471822
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
donquixote commentedThe change seems simple, but the conditionality is more tricky.
We should have some kind of feature detection support in core.
Comment #3
donquixote commentedThis patch is a first proof of concept, definitely not to be committed as-is.
It lacks the conditionality, and it lacks tests.
It is ok for people who want to patch both core and field_group to get the machine name column.
Comment #4
anybodyNice @donquixote! :) Can you please turn this into a MR?
Comment #7
duaelfr@anybody There you go.
Now #3306820: Show machine name in "Manage form display" and "Manage display" table row has been released. This causes an issue where the weight field for the field_group line is displayed. Dragging the field_group around is still functional but it can be troubling for end users.
Comment #8
nils.destoop commentedThe fix will need to be smarter. As the column only exists for 11.1. We don't want to break the screens of sites running an older version.
Comment #9
duaelfrI don't know why I was convinced that 4.X was D11 only. My bad.
Is it better like this?
Comment #10
donquixote commentedI would suggest to use some kind of feature detection instead of version detection.
This way we also support sites that apply a patch.
Not sure yet how that would work..
Comment #12
scott_euser commentedNot the cleanest as there is no array key, but would this be okay?
Comment #13
joevagyok commentedThe solution is looking good for me! Thanks @scott_euser and everybody involved.
Comment #14
ikam commentedI've tried the patch https://www.drupal.org/project/field_group/issues/3471822#comment-15755143 and it works for me (using Drupal 11.1.5 and Firefox 136.0)
Comment #15
grevil commentedAgreed, LGTM! Thanks everyone!
Comment #17
grevil commentedComment #18
joevagyok commented