Tabs are no longer draggable in manage form display

Created on 31 July 2024, 4 months ago
Updated 8 September 2024, 3 months ago

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

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States redndahead

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @redndahead
  • πŸ‡³πŸ‡΄Norway matsbla

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

  • Status changed to Needs review 3 months ago
  • πŸ‡ΊπŸ‡ΈUnited States redndahead

    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.

  • πŸ‡ΊπŸ‡ΈUnited States redndahead
  • Status changed to Needs work 3 months ago
  • πŸ‡³πŸ‡΄Norway matsbla

    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.

  • Status changed to Needs review 3 months ago
  • πŸ‡ΊπŸ‡ΈUnited States redndahead

    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.

  • Status changed to Needs work 3 months ago
  • πŸ‡³πŸ‡΄Norway matsbla

    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.

  • πŸ‡ΊπŸ‡ΈUnited States redndahead

    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.

    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.

  • Status changed to Needs review 3 months ago
  • πŸ‡ΊπŸ‡ΈUnited States redndahead

    Adding Patch

    • 7aebaaec committed on 2.0.x
      Issue #3465051 by redndahead, matsbla: Tabs are no longer draggable in...
  • Status changed to Fixed 3 months ago
  • πŸ‡³πŸ‡΄Norway matsbla

    Perfect, thank you!

  • πŸ‡³πŸ‡΄Norway matsbla

    One follow-up issue πŸ› Remove layout regions from formatter list Active

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

Production build 0.71.5 2024