Problem/Motivation
If your Features component uses FEATURES_DEFAULTS_CUSTOM, the load routine for checking feature status -- the call stack from features_get_component_states() => features_get_signature() => features_get_default() => features_include_defaults() -- does not load defaults for components that declare a custom filename.
E.g. module.MYINCLUDE.inc is never loaded, and it's default hooks are not invoked.
While this can be worked around by the implementing component, it creates code duplication that should be avoided.
Proposed resolution
Fix features_include_defaults() and features_get_default() to respect custom files.
Remaining tasks
Needs a patch and a test.
User interface changes
None.
API changes
No changes. Actually allows hook_features_api() to function as documented.
Comments
Comment #1
agentrickardThis may also be related to #1247454: Features with domain settings cannot be updated _from drush_, which is a pretty fatal API error in Features, I think.
Comment #2
agentrickardNope. It isn't.
Comment #3
hefox commentedQuickie untested patch
Comment #4
hefox commentedUsed the wrong define
Comment #5
agentrickardThis appears to resolve the issue; though the code is a bit hard to read.
Comment #6
mpotter commentedCommitted this to a92e04e.
Comment #7
mpotter commentedActually had to modify this a bit. The patch as it stood caused all Views/ctools features to be marked as overridden. First change needed to be:
- if ($component !== 'views' && !isset($info['api']) && (!isset($info['default_file']) || $info['default_file'] !== FEATURES_DEFAULTS_INCLUDED)) {
+ if (!isset($info['api']) && (!isset($info['default_file']) || $info['default_file'] !== FEATURES_DEFAULTS_INCLUDED)) {