Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#1 | field_group-default-classes-on-create-2076419-1.patch | 596 bytes | alexweber |
Comments
Comment #1
alexweber CreditAttribution: alexweber commentedSimple fix, when adding default classes for a new field group just implode the array to cast it to a string.
Comment #2
nils.destoop CreditAttribution: nils.destoop commentedCompletely correct. Pushed it to dev.
Comment #3
nils.destoop CreditAttribution: nils.destoop commentedComment #4
alexweber CreditAttribution: alexweber commentedAwesome, thanks! :)