The function field_group_field_group_pre_render pass settings for the elements js :

  // Add all field_group format types to the js settings.
  $element['#attached']['drupalSettings']['field_group'] = array(
    $group->format_type => $group->mode,
  );

Variable $group->mode returns 'default' instead of 'form' or 'view' options which are used in js code.

  /**
   * Implements Drupal.FieldGroup.processHook().
   */
Drupal.FieldGroup.Effects.processHtabs = {
    execute: function (context, settings, type) {
      if (type === 'form') {

Therefore all implementations of the Drupal.FieldGroup.processHook() don't work correct.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ozin created an issue. See original summary.

ozin’s picture

Status: Needs work » Needs review
FileSize
814 bytes

Patch attached, please check.

pixelmord’s picture

I came across this issue after I found the issue regarding the required field indicator:
https://www.drupal.org/node/2643558

This patch was noted there as prerequisite, so I applied this one before and it made the other patch work. I am not familiar with the reasoning behind these values for the drupalSettings affected by the patch, but for me this worked.

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

Status: Needs review » Fixed

Thx for the patch. I adjusted it a bit so the js gets more info.

Status: Fixed » Closed (fixed)

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

Status: Closed (fixed) » Needs work

The last submitted patch, 2: field_group-incorrect-settings-2643360-1.patch, failed testing.

aspilicious’s picture

Status: Needs work » Closed (fixed)