Both Vertical and Horizontal tabs on the same page do not work

Created on 7 February 2025, 3 months ago

Problem/Motivation

If you have both vertical and horizontal tabs on the same page, the 'required' functionality will not work since modules/contrib/field_group/formatters/tabs/tabs.js is only called with whichever happens first: horizontal or vertical

This is because 'tabs' is considered the 'format type' rather than separation between the two tab types. This means the settings passed will either be 'horizontal' or 'vertical', not both.

Steps to reproduce

  1. On the same entity, create both horizontal and vertical tab groups with required fields
  2. Ensure that 'Mark group as required if it contains required fields' is ticked

Proposed resolution

Process both horizontal and vertical tabs if existing

Remaining tasks

Refactor the code to allow for this

User interface changes

All field groups with required fields are highlighted as required even if there is a mix of horizontal and vertical tabs.

API changes

N/A

Data model changes

N/A

πŸ› Bug report
Status

Active

Version

4.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom scott_euser

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

Merge Requests

Comments & Activities

  • Issue created by @scott_euser
  • Pipeline finished with Canceled
    3 months ago
    Total: 164s
    #417784
  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    Before:

    After:

  • Pipeline finished with Failed
    3 months ago
    Total: 326s
    #417786
  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    Tests pass fine once πŸ› Drupal 10.4 RC1 error with field_ui.js Active is merged (applied manually locally and ran tests).

    Phpcs, cspell, and eslint are all existing warnings. Probably best not to scope creep and fix here, so leaving as is.

  • Pipeline finished with Success
    3 months ago
    Total: 467s
    #422860
  • Pipeline finished with Success
    3 months ago
    #422880
  • Issue was unassigned.
  • Status changed to Needs review 4 days ago
  • πŸ‡ΊπŸ‡ΈUnited States stacypendell

    We're seeing a similar issue fixed by this patch - thank you!

    In our case, two content types have both vertical and horizontal tabs. The first set of horizontal tabs disappears entirely when the module is upgraded from 3.6 to 4.0.0. The missing tab group reappears when the patch is applied. No 'required' functionality is involved. None of the other tab groups are affected, only the first one.

    I'm happy to provide more information or do more testing if that would help.

Production build 0.71.5 2024