I have a feature for a content type, where the field component is overridden. If I run a drush feature-revert on this feature it incorrectly empties field data.
The entity and field definitions are left in tact, but there's no data in the fields (with one exception). If I check the field_data_* tables in the database they're empty.
The one exception is a (file) field which is shared between content types. That data is left intact.
If I run the revert through the web admin I don't get the issue.
If I run "features_revert(array($module => array($component)));" from a test module there's no problem.
i've turned on mysql logging. The only thing of note it appears to be doing is writing to the cache_field table.
Any ideas on what could be doing this, or how to debug further? I'm at a dead end.
I can repeat the test easily and produce debug output on request.
Thanks
James
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | field-config.txt | 887 bytes | tunny |
Comments
Comment #1
buddaIt might be useful to log each $component to see at what point the destruction is caused?
in features.drush.inc the loop is:-
Did you do --force to cause the problem?
Comment #2
hefox commentedYea, it'd be nice to know when it's happening.
I think this is a duplicate, recall seeing something about if a month or 3 ago
Comment #3
tunny commentedThe destruction appears to be happening when field_update_field is called.
See the field_features_rebuild method in features/includes/features.field.inc, line 166.
If this line is commented out the data isn't lost.
I've attached a dump of $field_config. It appears correct. The config is identical when it's reverted through a browser, and no data loss occurs then.
So I've got a bit further, but I'm stuck again.
Comment #4
hefox commented#1305226: Features install/revert/etc. sometimes emptying field data
Suspect it's a core bug
Comment #5
tunny commentedThanks for pointing me at that thread, the explanation fits perfectly.
drush is running as anonymous and the access check being performed, whereas in the features UI I'm superuser and the check will be skipped.
Comment #6
arrubiu commentedSubscribe