In the most recent Feature module version, fields are no longer saved as one feature component type, but split in 'field_base' and 'field_instance'. I think field_group_features_export_alter() needs to be altered so the detection is done based on 'field_instance' instead of 'field', based on some clever feature detection.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jorrit’s picture

Status: Active » Needs review
FileSize
720 bytes
1.13 KB

Here are patches for -dev and 1.1. This will break compatibility with Features before 2.0-beta2.

DamienMcKenna’s picture

Shouldn't this be backwards compatible?

DamienMcKenna’s picture

This should be backwards compatible.

Jorrit’s picture

Thanks!

Stalski’s picture

ah cool, thx for the patch!

I'll try to make a big patching session at the end of this week. This one is an important one

killtheliterate’s picture

Patch from #1 doesn't seem to be exporting $field_group->data, though it is adding labels now.

DamienMcKenna’s picture

@killtheliterate: Please review the patch in #3, it supersedes #1.

KarlShea’s picture

Status: Needs review » Reviewed & tested by the community

Worked for me in a previously-broken feature.

killtheliterate’s picture

Tried git apply, then patch <

Didn't apply cleanly, but created this file. I'll take a look at this, though can't right now.

DamienMcKenna’s picture

This is a reroll of #3 for 7.x-1.x.

DamienMcKenna’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev

FYI the same patch applies to both 7.x-1.x and 7.x-2.x.

killtheliterate’s picture

Still not getting anything in field group features exports. Notably, when I run update.php, I encounter the following error:
Notice: Uninitialized string offset: 0 in field_group_unpack() (line 1507 of .../field_group.module)

jhodgdon’s picture

FileSize
42.38 KB

This patch is not working for me either. For one thing, it didn't apply. But when I got it to apply, it also didn't fix the Fieldgroup/Features problems I am seeing, which I think are supposed to be fixed by this patch?

The behavior I seeing is exactly the same whether I use Fieldgroup 7.x-1.1, or 7.x-1.x-dev with the patch in #10 (and we're using Features 7.x-2.0-rc1):

- I create a feature that includes a Commerce Product type with some fields and field groups on it.
- I verify that the field groups, fields, and field instances are all present on the Create Features page. (With 1.1 or with the patch, the field groups were added automatically to the Feature when I selected the Product type.)
- After downloading and then enabling the Feature, it shows up on the Features page as Overridden, even though I have just created it.
- Checking the overrides with the Diff module shows that the 'data' element of the field group array is empty in the original, and non-empty in the override (i.e. the override appears to be correct, as it shows the fields the group should have inside it). See attached screen shot.
- If I go to the "re-create" tab, there is no change to the feature when I recreate it. It exports exactly the same every time, with an empty 'data' array.

So I think this should probably be set back to "needs work" but because I am not absolutely sure this patch is supposed to address the issue I outlined here, I have not done so. As far as I can tell, the patch doesn't change the behavior of field groups in Features in any way.

jhodgdon’s picture

I did some debugging about this problem and added a comment to this issue:
#1619154-59: Fieldgroup exported feature reports as Overridden just after creating the feature

I am not sure what I am seeing and reported here in the previous comment is related to this issue, because I am not seeing that this patch does anything good or bad to the Field Group module's features integration... I'll continue the discussion on that other issue I guess.

alexkb’s picture

On the latest -dev version of field_group, I had to manually apply the #10 patch, and when I did, the field groups exported ok, without showing the feature overridden. We're using features 7.x-2.0-rc1.

alexkb’s picture

Re-rolled patch attached to help.

akalata’s picture

Status: Reviewed & tested by the community » Needs work

Doesn't seem like this is still RTBC?

nils.destoop’s picture

Status: Needs work » Needs review
FileSize
1.68 KB

When applying the patch, the fieldgroups where still not auto-detected. A small fix was enough, can someone test?
It also looks like the auto-detect of features is broken, you have to push the refresh button first, before he finds any dependencies.

Status: Needs review » Needs work

The last submitted patch, field_group-features-1966624-18.patch, failed testing.

nils.destoop’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, field_group-features-1966624-18.patch, failed testing.

nils.destoop’s picture

Status: Needs work » Needs review
nils.destoop’s picture

Version: 7.x-2.x-dev » 7.x-1.x-dev
nils.destoop’s picture

Status: Needs review » Fixed

#18 has been committed to dev

Status: Fixed » Closed (fixed)

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

  • Commit 509572c on 7.x-1.x, 8.x-1.x authored by DamienMcKenna, committed by zuuperman:
    #1966624 Feature 7.x-2.0-beta2 defines fields in a new way