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.
I have an entity type with some fields and a fieldgroup, all in a feature.
When I delete a field, the feature notices: 'drush fu' removes it from the feature code.
When I delete a fieldgroup, drush fu has no effect. I have to remove the fieldgroup from the feature by unselecting it in the features admin UI.
Comments
Comment #1
hefox CreditAttribution: hefox commentedGoing to kick this to field group to see if they have an opinion. I believe features just provides ctools support which field group is using for exportables. Why is field group allowing deletion of stuff that is in code?
Comment #2
milos.kroulik CreditAttribution: milos.kroulik commentedI also seem to have this problem. In my case, there are even field groups from deleted content types.
Comment #3
simeThis issue is over 2 years old, so marking it outdated. Please reopen if this is an ongoing concern, I would consider reviewing further.
Comment #4
ron_s CreditAttribution: ron_s commentedThis has been an issue forever and continues to be. Whenever a field_group is deleted, it is not removed from the feature. Instead, it marks the field_group as
$field_group->disabled = TRUE;
The only way I have found around this is to write custom code that loops through the results of
field_group_info_groups
, does a comparison with thedefault_field_group
variable, and removes anything fromdefault_field_group
which no longer exists.I actually don't even know where the
default_field_group
variable gets created or updated... I cannot find any reference to it anywhere in code, either the field_group module or core. It has to be something where its variable name gets concatenated before storage.Comment #5
ron_s CreditAttribution: ron_s commentedOne additional bit of advice regarding this issue... a lot of headache can be saved by removing the field group to be deleted from the feature prior to deleting it.
Re-create the feature with the field group removed, such that the feature does not even know the field group exists. Also manually remove the references to
features_exclude[field_group|....]
that you will find in your feature ".info" file. Then delete the field group, and re-create the feature again.This is certainly time-consuming to have to do so in multiple steps, but will at least ensure the feature is correct and does not contain the deleted field group.