On lines 635 and 636 of field_group.field_ui.inc:

    $classes = _field_group_get_html_classes($new_group);
    $new_group->format_settings['instance_settings']['classes'] = $classes->optional;

Looking at _field_group_get_html_classes(), it's clear that $classes->optional is an array.

However, $new_group->format_settings['instance_settings']['classes'] expects a string (no special treatment in submit callback for editing field groups).

Also, field_group_format_settings_summary() expects a string value and check_plain() chokes on the array.

Implementing hook_field_group_format_summary() doesn't allow us to fix that either as it only appends content to the summary and doesn't allow altering it.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexweber’s picture

Status: Active » Needs review
FileSize
596 bytes

Simple fix, when adding default classes for a new field group just implode the array to cast it to a string.

nils.destoop’s picture

Status: Fixed » Needs review

Completely correct. Pushed it to dev.

nils.destoop’s picture

Status: Needs review » Fixed
alexweber’s picture

Status: Needs review » Fixed

Awesome, thanks! :)

Status: Fixed » Closed (fixed)

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

  • Commit 11660d9 on 7.x-1.x, 8.x-1.x authored by alexweber, committed by zuuperman:
    Issue #2076419 by alexweber: Fixed Classes stored as string but treated...