Seem to get this message when I deploy new feature code, before clearing the cache, doesn't seem to do any harm...(yes the xxx.features.inc does exist).

Comments

aacraig’s picture

I'm getting this same warning

jgraham’s picture

I believe this is caused when a feature evolves over time, and when it was initially built it did not have a xxx.features.inc file.

The more technical explanation is that when a feature is initially created with a xxx.features.inc file features will put the snippet inside of xxx.module which includes xxx.features.inc for you. However, on subsequent features updates features module checks and notices that the xxx.features.inc file is not included and throws the warning. Rather than potentially clobbering custom code that you may have added inside of xxx.module during a features update features instead outputs the warning.

To resolve this add the following in your xxx.module file (this is the code that features would have added for you if your feature initially had a xxx.features.inc file);

Make sure this is not on the first line and after the '<?php'

include_once('xxx.features.inc');

I think this issue should be "won't fix" or "works as designed" as clobbering custom code would be bad. However, the documentation/warning might need some improvement.

stephenrobinson’s picture

added this, and it got re-exported so I guess everything is hunky dory

Grayside’s picture

There are several long issues addressing alternatives in how to handle this.

dynamicdan’s picture

Priority: Minor » Critical

This is totally a big ass ugly bug.

I have 4 features setup, all different and all working well.

My scenario:
- added some fields for a content type (these fields are field collections that exist in field groups)
-> Features added 'Field collection' and 'fieldgroup' as dependencies for me
- created/exported my feature and installed
-> 'Overwritten'
- tried again, no luck

I thought it might have been a bug with fieldgroup but couldn't find any problems there. Turned out I had to add the include to fix the problem. Note that I only occasionally got the warning message about not including the xxx.feature.inc file. Also note that I never added any custom code to that module. Would be nice if features was intelligent enough to figure that out. Perhaps set $xxx_feature_custom_code = false; and ask devs to change it to true when they actually start editing that file?

In the case that fieldgroup was the culprit, I would at least ensure that the features warning in consistent and easy to find. I know I'm not the first to have this problem.

mpotter’s picture

Priority: Critical » Normal

Please do not open old issues and then mark them as critical like this. Critical issues are only for show-stopping bugs that prevent anybody from using the module. In your case it's related to your specific features and the specific history used in creating the features.

What I believe is the problem is if you initially create a feature that does not have any dependency on the module_feature.inc file (so no include statement is added). But then later you add something to the feature that requires this file. At that point, Features sees content in the *.module file (even though it's just the comments at the top) and refused to modify this file to add the include statement (for fear of messing with the existing contents).

This is by no means a critical issue. There are several workarounds as mentioned above. Including just following the warning and placing the include line into the specified file.

If you still have an issue about Overridden features, create your own Issue and include a clear step-by-step approach for reproducing the problem.

mpotter’s picture

Status: Active » Closed (duplicate)
donquixote’s picture