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

agentrickard’s picture

This 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.

agentrickard’s picture

Nope. It isn't.

hefox’s picture

Status: Active » Needs review
StatusFileSize
new1.88 KB

Quickie untested patch

hefox’s picture

Used the wrong define

agentrickard’s picture

This appears to resolve the issue; though the code is a bit hard to read.

mpotter’s picture

Status: Needs review » Fixed

Committed this to a92e04e.

mpotter’s picture

Actually 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)) {

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.