I experienced some weirdness where all Profile2 fields disappeared when disabling and reenabling a features module and I assumed it was an issue with Profile2 like this:
#1316874: Profile2 exported via Features yields broken profiles, disappearing fields
After a lot of digging around, I found that the .info file had "features_exclude" instead of "features" in the .info file for the missing fields. The developer who recreated the features module did not exclude these fields.
I talked to another developer (on a different project) and they found a similar issue where "features_exclude" items ended up magically appearing in their features modules' .info files. She thought it might be due to generating the features module directly into the code directory rather than downloading the module code and then installing (she appeared to have better luck with the latter method).
I did not see any issue in the issue queue that refers to "features_exclude", so maybe this is a new issue... I think it is a bug of some sort but it is not clear how to reproduce. Perhaps there is some auto-dependency issue?
Comment | File | Size | Author |
---|---|---|---|
#23 | xd-16635.jpg | 5.06 KB | Kristen Pol |
#14 | 1978288-features_exclude_field-14.patch | 1023 bytes | hefox |
Comments
Comment #1
Elijah LynnI think this was just introduced with 7.x-2.0-beta2 (release notes). I am not entirely sure what features_exclude[] is for yet but it is discussed in this issue http://drupal.org/node/1064472#comment-7196064
Comment #2
Kristen PolThanks! At least he is saying it is totally okay to "remove" those "features_exclude" items (though actually, I had to change them from "features_exclude" to "features"). If I could go back before beta2, I would but I don't think that would work because it looks like the API changed.
Comment #3
Elijah LynnThe features_exclude items are a bit confusing. I think we can propose a better name for them. It is also confusing since you only get them when you export via the GUI.
Comment #4
hefox CreditAttribution: hefox commentedI just got this also.
features_excludes are suppose to be items you've deliberately excluded from having in the feature.. so.. odd that it adds the items you want XD
Comment #5
RunePhilosof CreditAttribution: RunePhilosof commentedCould it be that you haven't deleted the featurename.features.field.inc file from your feature?
See http://www.phase2technology.com/blog/new-field-bases-and-instances-in-fe...
I think features should detect and warn users when they have both base/instance and deprecated field export in a feature.
Comment #6
hefox CreditAttribution: hefox commentedMy case happened while making a completely new feature
Comment #7
DamienMcKenna@RunePhilosof: see #1959076: Features does not remove the several known deprecated files, but as hefox says it isn't relevant to this issue.
Comment #8
DamienMcKennaThis has also been bugging me with text filters - I'll build a feature via the GUI that has all of the pieces I want, then later update via Drush only to have it move some of the filters into features_exclude.
Comment #9
Elijah LynnNot sure if this should have been part of this issue but I submitted a separate issue & patch for renaming features_exclude to features_ui_autodetect_exclude here -> #1990290: Rename features_exclude to features_ui_autodetect_exclude (less confusing)
Comment #10
DamienMcKennaClosed a duplicate: #1993824: features_exclude being generated in info file when not required?
The issue there was that errant lines were being added to the info file, e.g.:
Comment #11
hefox CreditAttribution: hefox commentedThe field ones are likely coming from a contrib module that hasn't been updated for the field change. I noticed that got added to mine after adding a new component. Can't remember which contrib module it was.
However, seen this outside of 'field'
Comment #12
DamienMcKenna@hefox: One of the modules that used to do automatically add fields was field_group, but I'm running the patch from #1966624: Feature 7.x-2.0-beta2 defines fields in a new way and still seeing the problem.
Comment #13
hefox CreditAttribution: hefox commentedThat shouldn't be causing this, since
would only run if $export[features][field] was already set
(I think I saw them starting to be added when a field_group was added, but looked and saw that ^)
Comment #14
hefox CreditAttribution: hefox commented... not contrib :<
I don't see any reason it still should be suggested by node anymore. Not sure why we're not automatically switching those using fields to field and field bases (perhaps due to multi uses of the field and only updating one?).
Anyhow posting this here, but think this is only a symptom (though a issue on it's own). If anyone debugs a more features_exclude specific problem and comes up with a patch, I'll open a new issue for this.
Comment #15
n_potter CreditAttribution: n_potter commentedThanks for directing me to this thread, I have read the links provided; my understanding is then that this version of Features has split the field settings into Base and Instance. The problem I am having is that the instance settings (weighting, visibility, etc) that are in code are being overriden by the presence of features_exclude lines which get automatically shoved into the .info file when I recreate/regenerate the feature.
The modules I'm having a problem with are old features (generated over a year ago) with added custom code. Perhaps it would be prudent to rebuild the feature from scratch in 2.0 and re-introduce the custom module code & clean up?
Apologies if I missed something in the thread, but have we a solution for how to stop this behaviour, or is this a bug?
Comment #16
mpotter CreditAttribution: mpotter commentedPatch in #14 worked with the different test cases I tried it on. It removes the features_exclude[fields] stuff without affecting features_exclude[fields_base]. So I committed this to 42c003e.
This fixes the original issue, so if there is still any trouble with missing fields, please open a new issue to track it.
Comment #17
hefox CreditAttribution: hefox commentedNote that some people may be experiencing this #2000238: Convert 'field' to 'field_instance' on features-update (fu) bug
Comment #18
hefox CreditAttribution: hefox commentedLooks like some of us are a bit too quick for the new UI #2005596: If generate/recreate a feature before autodetection has returned, autodetected items end up in features_exclude
Comment #19
Kristen PolFyi, I tried #14 and we are still seeing the features_exclude items. I'm going to try some of the patches on the related issues.
Comment #20
hefox CreditAttribution: hefox commentedBased on mpotter's fixed message, please leave this closed and look over existing issues/open a new one with more information for additional bugs. This is one of the "several things can produce the same bug" things
Comment #21
Kristen PolAh... okay ;) I created the issue so thought it would be okay to reopen it. I don't have any other information on why these features_exclude comes up so this is the only issue that is relevant to me at the moment. I looked at the other issues and tried the patched but no luck. I'll just hope it gets fixed somewhere and gets into dev at some point... since we are aware of the issue, we just remove the features_excludes as needed.
Comment #22
hefox CreditAttribution: hefox commentedI may have not noticed you created this issue XD
Comment #23
Kristen PolNo worries! I had to look up XD ;)