So one problem with drag and drop is that if you move a field or a field group outside a group above the group, the parent is not reset to none. It seems to happen only if you move it to the top of the table.
To reproduce
- Create a tabs group and put it on top of the table
- Create a tab group and nest this underneath
- Nest a field, say the body, under the tab and save
- Now drag the body to the top of the table, in the root. Then hit 'Show row weights'. The parent will still be the first tab
Note: after some tests, a simple single group, say details, is good enough to to reproduce this bug! See the small video underneath to see how to reproduce it.

It looks like that is fixed in #3089151: TableDrag JS :first-of-type issues.
Other things:
- Tabs also sometimes act weird.
- I was able to get to a state as well where no region value was set for a field, becoming empty.
Not sure yet how to reproduce these two consistently, will document more when I can.
So this seems like a core problem. But let's see if we can we fix this ourselves as this makes it very tedious to drag and drop groups in general. If you comment out line 332 of includes/field_ui.inc (the library), you hit the same bugs.
| Comment | File | Size | Author |
|---|---|---|---|
| #32 | 2025-04-28-17.27.27-field_group-instructions-if-drag-and-drop-is-not-working.png | 126.82 KB | michaellenahan |
| #18 | Screenshot 2019-10-12 at 17.56.48.png | 187.71 KB | nils.destoop |
| #14 | field-group-select-parent.gif | 924.74 KB | swentel |
Comments
Comment #2
swentel commentedComment #3
swentel commentedAdded related issues.
Comment #4
swentel commentedComment #5
swentel commentedComment #6
swentel commentedSo I do really thing this is a problem with core tabledrag js. The annoying thing is that I can't find any implementations in core that use an explicit parent select field for now. Are there other contrib modules that do this ?
Comment #7
swentel commentedComment #8
swentel commentedComment #9
swentel commentedComment #10
swentel commentedComment #11
andypostIt works but randomly fails for me(
Comment #12
swentel commentedConfirmed this is most likely a core problem. If you uncomment
$form['#attached']['library'][] = 'field_group/field_ui';, you hit the same bug with the parent not resetting. Checking if there's a core issue about it. Setting to major as this isn't directly field group's fault.Comment #13
andypostLooks related
- #3062742: Drag-and-drop reordering doesn't work if the region content is nested in other elements
- #819816: (Needs tests) Reordering multivalue file and image field uploads is broken
Comment #14
swentel commentedCreated an animated gif so people can see the problem to reproduce. It shows how the parent is not reset when dragging a field to the top.
Comment #15
swentel commentedComment #16
andypostAlso related changing JS-lib for sorting and looks #1491406: Improve the reordering and reparenting UI if any term has a multiple hierarchy affected by the same
Comment #17
nils.destoop commentedLooks idd tabledrag related. If you make the js files of field_group and field_ui empty, the region is still lost when moving my tab. The region is always lost when you make a group a lvl 2 group. As long as the group stays in the root, the region is not lost.
Comment #18
nils.destoop commentedThe issue seems to be related with the options given to tabledrag. When you drag something to a parent, it receives .field-name as source element, while this is the source element for parent, not for region.
If I remove the source in EntityDisplayFormBase, or set the source to field-region, everything is working on the manage form for fieldgroup. But on the display management, it is still broken in combination with DS due to js errors.
Comment #19
nils.destoop commentedCreated #3087608: Tabledrag is resetting the region value if items are nested for core
Comment #20
nils.destoop commentedAlso created #3087612: DS resets all the rowHandlers to field for an issue with DS.
Comment #21
swentel commentedMmm tried the core patch but it doesn't seem to fix the issue which you can see in the animated gif at the top on manage form display. So something else is still doing something weird.
Comment #22
andyf commentedHi, I noticed some issues with tabledrag selectors recently, and I think they may explain the problem here. The following code from tabledrag:1092 uses the selector
tr.draggable:first-of-typeto grab the first row of the table, but that fails if you have a non draggable first row (which on the node form display is the No field is displayed row).I think I've found a few similar errors in #3089151: TableDrag JS :first-of-type issues. From my manual testing the patch there fixes the problem here, but frustratingly I can't get the automated test to drag the second row up above the first (although I can move a row up in the weight test...).
I'm tentatively setting the status to needs review despite there not being a patch here, not 100% sure what the best approach is.
Thanks!
Comment #23
liquidcms commentedi saw this post #3064890: Notice: Undefined index: name in Drupal\field_ui\Element\FieldUiTable::reduceOrder() (line 228 of /var/www/html/docroot/core/modules/field_ui/src/Element/FieldUiTable.php) which is closed as a duplicate, possibly of this issue (but mentions another related to DS, which is not my issue).
It does seem as though Field Group latest (-rc2) is broken. I see on a node form display page that i do have FGs set up and working correctly; but trying to add a new one and i get the reduceOrder error reported in the original issue, plus i can not move it out of disabled.
I see that up until a couple weeks ago i was using -rc1; so perhaps that is why i have working FGs placed on my form. Although, i tried now going back to -rc1 and although the reduceOrder error does not show, i still cannot place the FG and i get a new error (guess due to db change required for -rc2 update).
Not sure if any point in going back to try 1.x version.
Glad to see this is marked as Major as Field Groups must be one of those "Drupal 8 release blocker" sort or modules, I would think.
Comment #24
andyf commentedJust a quick update: the patch in #3089151: TableDrag JS :first-of-type issues seems to fix the first issue described in the IS and shown in the gif, and since #2769825: Cannot swap tabledrag rows by dragging the lower over the upper row in tests the tests work as well. I'm not sure whether it addresses this from the IS:
or this from #23:
Comment #25
liquidcms commented@AndyF, yes, the 2 core patches in #24, against 8.8.0, fix my issue. :)
Comment #26
gaëlgFor anyone facing a similar problem, here's a hint. I had field groups configured as "region: hidden" in my config yml files, despite they had "enabled" children. So that on the entity form display edit form, those groups appeared twice, in the content region and in the hidden ("Disabled") region. I changed their config to "region: content" and it fixed my ordering/weight/tabledrag problems. No other patch needed for me.
Comment #27
devil2005 commentedHi
Same problem on a fresh D10 and dev version of the module... Can't save my groups with correct order or children, they save them random in template
Comment #28
sergioitdo commentedSame problem too on a D10. I'm not abled to save the changes after order or children, they items stay on the same place.
Comment #29
erutan commented@sergioitdo have you tried applying the following patch to core?
https://www.drupal.org/files/issues/2023-02-08/3089151-45.patch
Comment #30
boby_ui commented#29+1 fixed the drag and drop issue in D10 too
Comment #31
webmestre commentedOnce patched, on Drupal 10.1.5, the drag'n drop works.
BUT the created structure is unstable: i.e. tabs don't stay nested as designed when re-opening the form edit page.
Comment #32
michaellenahan commentedJust in case anyone comes to this issue from google, here is a screenshot with some instructions on how to manually set the weights if drag and drop is not working for you.
https://www.drupal.org/files/issues/2025-04-28/2025-04-28-17.27.27-field...
Comment #33
grevil commentedHey everyone, it feels like this issue got a bit off track. The issue summary including the video seem to be unrelated to the patch that is suggested as a potential fix here.
Since I wanted to preserve the conversation here, I created a separate issue, targeting the same issue. Feel free to test the patch from #3538795: Manage Display: Child fields moved from groups to "ground level" retain parent relationship in combination with the core patch from #3539083: Field UI: Parent-child relationships not properly updated when fields are moved via drag-and-drop (Field Group).
If the feedback is good, I'll close this issue as a duplicate of #3538795: Manage Display: Child fields moved from groups to "ground level" retain parent relationship, otherwise we can keep it open as a follow-up issue and adjust the issue summary. Until then, I'll set it postponed.
Comment #34
anybodyI agree this is probably fixed by the MR in #3538795: Manage Display: Child fields moved from groups to "ground level" retain parent relationship now, please try the patch over there and close this as duplicate, if it's fixed. The other fix is definitely the cleaner one, combined with the core fix from #3539083: Field UI: Parent-child relationships not properly updated when fields are moved via drag-and-drop (Field Group)
Comment #35
swentel commentedI'm not sure if it was really off track, as far as I can see. It's been a while since I've found the energy to dive into this one as it's tricky :) There are basically two problems (in core) with tabledrag:
- not changing the parent, tracked in #3089151: TableDrag JS :first-of-type issues. Some people report that it fixes the issue.
- (re)setting the region value, tracked in #3087608: Tabledrag is resetting the region value if items are nested - but it might be obsolete by the previous one.
Again, it's been a while, so I feel like there's actually too many issues open now, which makes it even more off track :)
Ideally, we can fix this in core. But I would be ok if we are able to fix this in field group, without having to rely on a core patch.
(it would be even better if FG just goes into core of course haha)
Note: I'm less involved nowadays, but I know this issue is tracked in couple of other issue, so I'd rather leave this one open as the 'canonical', thoughts?
(There was also a conflict of DS which gets in the way in although that should have been fixed already by #3087612: DS resets all the rowHandlers to field though)
Comment #36
swentel commentedRereading everything again, I'm still rather a fan of fixing this in tabledrag JS and see if we can get #3089151: TableDrag JS :first-of-type issues forward (if possible of course), where, afaics, the fundamental problem lies. Only fixing it in core for field ui, would still leave problems for other UI's (although I'm not sure how many other's have nesting and multiple regions, but oh well).
Also #3333953: Nested field groups improperly display as "Disable" in the admin UI is a duplicate - where someone also reports that #3089151: TableDrag JS :first-of-type issues might fix things.
Will debug some during the weekend to get a clearer view.
Comment #37
andyf commented@swentel if you're able to give a bit of time over to a review of #3089151: TableDrag JS :first-of-type issues I could summon the courage to get back in on the dev side. I backed off a bit because it was getting at best cursory reviews, but it'd be neat to take it over the finish line... assuming tabledrag hasn't completely changed in the meantime at least (: Completely understand if you don't have time btw, jus thought I'd mention it.
Comment #38
grevil commentedFirst off, I am shocked, that field_ui doesn't have a direct dependency on tabledrag.js. I was already wondering how changing the behavior of tabledrag.js would affect field_ui.js, since there is no dependency between the two.
Second, I couldn't replicate #3087608: Tabledrag is resetting the region value if items are nested at all, which got me wondering why. Turns out, the gin admin theme (which we use on all projects) provides its own tabledrag.js override, see https://git.drupalcode.org/project/gin/-/blob/5.0.x/js/overrides/tabledr....
Since gin will replace claro in the future, see https://www.drupal.org/about/core/blog/drupal-core-will-adopt-gin-admin-... and claro is currently the only theme using drupal cores tabledrag.js I wouldn't waste time fixing a file which will probably get replaced by its gin counterpart anyway.
I would suggest fixing it in gin instead, but I am still unsure what's wrong with the approach in #3539083: Field UI: Parent-child relationships not properly updated when fields are moved via drag-and-drop (Field Group)? There is already similar logic in field_ui for changing regions, so why not simply do the same when changing parents?
Comment #39
swentel commentedApparently this happened from #3204862: Backport tabledrag.js for Drupal 8.8+. This is annoying. Not everyone uses Gin, or will use Gin in the future if it's in core (we often don't for instance).
Darn, this is annoying. It's likely safer to go forward with #3538795: Manage Display: Child fields moved from groups to "ground level" retain parent relationship then yes. We really don't want to add a dependency on an admin theme for this.
Comment #40
anybody@swentel thanks for your valuable feedback. Maybe you could then help with #3539083: Field UI: Parent-child relationships not properly updated when fields are moved via drag-and-drop (Field Group) and #3538795: Manage Display: Child fields moved from groups to "ground level" retain parent relationship so we can get this fixed asap?