Problem/Motivation

With this module enabled I can no longer move tabs around in the manage form display. My guess is it has something to do with this commit.

I think it's being too greedy in disabling any sub field group.

Steps to reproduce

  1. Create a content type.
  2. Go to manage display and add a tabs field group.
  3. Add 2 tab field groups underneath the one you just created. They should be draggable.
  4. Enable this module. They are no longer draggable.

Proposed resolution

Check to see if parent of group is of format type "layouts" and if it is then disable dragging.

Remaining tasks

None

User interface changes

None

API changes

None

Data model changes

None

Comments

redndahead created an issue. See original summary.

matsbla’s picture

StatusFileSize
new54.04 KB

Thank you for the feedback, can confirm the issue. Am attaching a screenshot as reference.

No longer possible move tabs around in the manage form display.

redndahead’s picture

Status: Active » Needs review
StatusFileSize
new748 bytes

Attached is a patch that seems to fix this issue. It checks the parent wrapper and if it's format type is layouts type it will disable dragging. I have tested it under tabs and with nesting layouts.

redndahead’s picture

Issue summary: View changes
matsbla’s picture

Status: Needs review » Needs work
StatusFileSize
new39.17 KB

Thanks for the effort, it works better, but still if you would manage to drag a group inside the layout groups they will now still not be movable anymore. Perhaps we also need to check if it is a layout col-element.

Tabs group inside Layout group displayed not movable.

redndahead’s picture

Status: Needs work » Needs review
StatusFileSize
new631 bytes

I'm running into big issues when you add a group element like you did. It changes the format from layout_region to something else. It don't think it has anything to do with this issue, but a problem when it reorders the items when you insert a new one. I'm not sure if that issue is with the field_group module or this module.

I'm attaching another patch that will only disable items that have their format set to layout_region. This will at least guarantee we won't affect other field group types.

matsbla’s picture

Status: Needs review » Needs work
StatusFileSize
new65.32 KB

Oh, could you perhaps try open an issue and provide clear descriptions of what happens and perhaps step to reproduce?

For the updated patch I tested it, but when applying it the layout col-element now becomes draggable again.

Layout col-elements becomes draggable

redndahead’s picture

I'll try and do my best to explain this.

When you create a new field group layout it sets the format type to layout_region. The problem is there is no format type called Layout Region. So it sets the field to the first item in the list. In my case it's tabs. You can see in the screenshot below that it's not draggable, but the layout is incorrect.
Layout Issues

The next time you save it will set the region to be the tabs format and it will be draggable again.

My solution is to create a new FieldGroupFormatter called Layout Region. This will make it so the default formatter after creating a new field group layout will be Layout Region and not tabs. Then when you save it will stick. The patch is attached.

This does bring up the question of why does this module have a FieldGroupFormatter called Default. Maybe this is what was supposed to be used for the regions, but I think Layout Region makes more sense.

redndahead’s picture

Status: Needs work » Needs review
StatusFileSize
new41.88 KB
new3.42 KB

Adding Patch

  • 7aebaaec committed on 2.0.x
    Issue #3465051 by redndahead, matsbla: Tabs are no longer draggable in...
matsbla’s picture

Status: Needs review » Fixed

Perfect, thank you!

matsbla’s picture

matsbla’s picture

Status: Fixed » Closed (fixed)

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