I posted this on http://drupal.org/node/1316874#comment-5705822 but I think it is a different issue than that of the original poster.

The issue is that reverting a feature containing a profile2 profile results in existing data being wiped.

I have just tested this on a vanilla D7 install with the following versions:

Drupal 7.12
Profile2: 7.x-1.2
Features: 7.x-1.0-beta6
Entity: 7.x-1.0-rc1

Here's the setup:
We have profile2 profile set up with a number of fields.
We export the profile as a feature and use this to deploy the profile2 configuration.
Reverting the feature via drush with force
drush fr {featurename} --force
results in all profile2 field data disappearing.

When prompted:
Do you really want to revert profile2_type?
Answering 'no', keeps the data. Answering 'yes' loses the data.

Steps to repeat:

  • Add fields to default profile2 entity.
  • Add data to these fields on a given user account.
  • Export profile to a feature, confirm feature is enabled and at default state.
  • Revert feature using drush :
  • drush revert {featurename} --force
  • Review data in user profile - profile fields are now empty.

I'll do some more digging to see if I can find why this is happening, but if anyone else has any ideas, I'm all ears.

Comments

finn lewis’s picture

Digging into the code a little further reveals that the profile2 entity is deleted and recreated upon feature revert.
After reading http://drupal.org/node/1043634 this looks like it is by design in entity module.
But should the field values always be deleted when the parent entity is deleted?
This does not happen for nodes, but I guess it will for other entities built on top of entity module, unless this is specific to profile2.

scor’s picture

Status: Active » Closed (duplicate)

please reopen if you can explain why your issue is different than #1316874: Profile2 exported via Features yields broken profiles, disappearing fields.

Note that this issue got resolved for me when upgrading to the latest dev snapshots of features, profile2 and entity.