Exporting a feature with field groups sometimes leads to $field_group->data being set to an empty string.

When this empty string is tested by field_group_unpack() $packed_group->data is set, but the reference to $group->label raises a warning.

function field_group_unpack($packed_group) {
if (!isset($packed_group->data)) {
return $packed_group;
}

// Extract unserialized data.
$group = clone $packed_group;
...
$group->label = $data['label'];

I've attached a patch that address this by testing for empty() instead of !isset().

Patch file field_group_patch-2189777-1.patch is for version 1.1
Patch file field_group_patch-2189777-2.patch is for version 1.3

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gmercer’s picture

Issue summary: View changes
FileSize
453 bytes
gmercer’s picture

Issue summary: View changes
FileSize
414 bytes
tim.plunkett’s picture

Status: Active » Reviewed & tested by the community

Confirmed! Works great.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 2: field_group_patch-2189777-2.patch, failed testing.

The last submitted patch, 1: field_group_patch-2189777-1.patch, failed testing.

nils.destoop’s picture

Status: Needs work » Fixed

No idea why testbot fails. Thx for the patch, committed to dev.

Status: Fixed » Closed (fixed)

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

  • Commit 406a0d2 on 7.x-1.x, 8.x-1.x authored by gmercer, committed by zuuperman:
    Issue #2189777 by gmercer: Exporting a feature with field groups...