Problem/Motivation

Using Gin admin theme after this commit https://git.drupalcode.org/project/field_group/-/commit/1211c8f4e0659241... the required marks are displayed on every tab item, even those that are already marked as required previously.

Steps to reproduce

Upgrade to dev-3.x 1211c8f and using Gin as admin theme.

Command icon 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

albefer created an issue. See original summary.

albefer’s picture

Issue summary: View changes
albefer’s picture

It seems the issue is in this file https://git.drupalcode.org/project/field_group/-/blob/1211c8f4e06592418c.... With this commit, we have switched from using .text() to .html() to build the content of the tabs. As a result, HTML tags, such as <span class="required-mark"></span>, are now included in the tab titles.

3cwebdev’s picture

We are seeing this issue as well when using Horizontal Tabbed field groups on the Gin theme. Switch to vertical tabs or a different theme removes the issue.

ultimike’s picture

Version: 8.x-3.4 » 8.x-3.5

I can confirm that using Gin with Field Group results in gin's tabs.css file being loaded in the front end (due to the Gin admin menu, I assume) and messing up many (all?) of Field Group's horizontal tab styles. 🙁

-mike

andrerb’s picture

StatusFileSize
new546 bytes
kufliievskyi’s picture

Thanks for the patch. I confirm that patch #6 fixes the issue. Tested on Drupal 10.3.0.

refs’s picture

I can also confirm that the patch fixes the issue for 3.6 and Drupal 10.3.0.

kevinvb’s picture

Status: Active » Reviewed & tested by the community

I can confirm the patch works on 10.3.1 with Gin admin theme 8.x-3.0-rc13 and field group on 8.x-3.6

andreic’s picture

I can also confirm that the patch fixes the issue for 3.6 with Drupal 10.2.6.

butterwise’s picture

Confirming patch in #6 fixed this issue (8.x-3.6, Drupal 10.2.7, Gin 8.x-3.0-rc13)

jonathan_hunt’s picture

Patch #6 worked for me on Field Group 8.x-3.6, Drupal 10.3.3, Gin 3.0.0-rc13.

anybody’s picture

Version: 8.x-3.5 » 4.x-dev

anybody’s picture

Please use MRs!

anybody’s picture

Merging based on the many RTBC's.

  • anybody committed 62ed4cc3 on 4.x
    Issue #3395375: Duplicated required marks in field tabs with GIn admin...
anybody’s picture

Status: Reviewed & tested by the community » Fixed
grevil’s picture

This introduced a regression. Created a follow-up issue here: #3473033: Horizontal Tabs render broken, if child allows HTML.

Status: Fixed » Closed (fixed)

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

pfrenssen’s picture

Would it be a good idea to commit this on the stable 3.x branch as well?

anybody’s picture

@pfrenssen I'm not against it. Still I think we should better focus on a stable 4.0.0 release!

rajab natshah’s picture

Thanks, Andre, for the patch in #6!
It is working with the Field Group ~3.0 version.

Hoping this fix makes it into the 8.x-3.x branch, especially since Field Group 4.0.0-alpha1 has been released. Many sites are unlikely to upgrade from ~3 to ~4 until an RC or the stable 4.0.0 release is available.

jedihe’s picture

StatusFileSize
new2.1 KB

For those of us on 3.6, I'm attaching a patch ported from #3473033: Horizontal Tabs render broken, if child allows HTML #15, only the changes for formatters/tabs/horizontal-tabs.js.

Minimally tested on horizontal tabs, enabling "Mark group as required if it contains required fields." now works as expected: only one required mark, only shown on tab titles for panes actually containing required fields.

rpearl’s picture

StatusFileSize
new1.38 KB

I also came across this issue with Gin 4.0.4 and Field Group 4.0.0-alpha1. The "Mark group as required if it contains required fields." checkbox option did not make any difference. I created this patch which gets around the issue and forces the required mark regardless of this option. There should be a better way to do this, but at least this patch would allow me to ensure that the horizontal tabs were always marked correctly (aka, I always want to mark the group required if there are required fields).

jedihe’s picture

Update: #24 is no longer needed after updating to field_group 4.0.0, using Gin theme.