If select "Mark group as required if it contains required fields." for the Vertical tab on the settings form it does not work.

Vertical tabs comes from the Drupal core so they do not have such functionality to mark the Vertical tab as required if it contains required fields. In order to fix this we need to add custom js for this. Actually we have such js in module call vertical-tabs.js in the folder formatters/vertical_tabs but it is not used. Also this javascript need to be fixed.

Comments

ozin created an issue. See original summary.

ozin’s picture

Status: Needs work » Needs review
StatusFileSize
new3.03 KB
pixelmord’s picture

Hi, I tried the patch #1 and ran in an issue that with more than one vertical tab one of the $(this).data('verticalTab').link in the collection was not defined (yet) and so execution was aborted due to the error thrown.

Also I think that looking for '.form-required' class as a test for required fields is not safe due to the fact that one could possible change those classes in the templates. So I think that searching for the required attribute on the input is safer.

Lastly I had to change the patch code for Tabs.php to be applicable for current HEAD.
Please review.

BTW. I think something similar should happen for the horizontal tab panes, I will try to search if an issue for this already exists.

  • zuuperman committed eb2c50f on 8.x-1.x
    Issue #2643360 , Issue #2643558 , Issue #2643382 Fix the required fields...
nils.destoop’s picture

Status: Fixed » Closed (fixed)

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

The last submitted patch, 2: field_group-vertical-tabs-js-2643558-1.patch, failed testing.

Status: Closed (fixed) » Needs work

The last submitted patch, 3: field_group-vertical-tabs-js-2643558-3.patch, failed testing.

aspilicious’s picture

Status: Needs work » Closed (fixed)