For a lot of components, allready exported components are still listed in the feature create list. This mostly has two reasons:

1) A bug in features_get_default_map() that does not including all default hook implementations, so the default map for some components is empty.
2) Missformatted export array of some contrib modules.

The first reason can be fixed by patching features (patch comes in first comment).
The second reason can be fixed only by the contrib modules (sure). The simple "trick" is to use, the component keys as keys for the rendered export array.

Comments

derhasi’s picture

Status: Active » Needs review
StatusFileSize
new2.08 KB
new928 bytes

Attached is the patch to refresh the module implementation of given hooks, as on the first call not all feature component files might be loaded.
The second patch is a small update for the .api.php to point to the relevancy of the exported keys.

hefox’s picture

Title: Allready exported components still listed in create new feature selection » Already exported components still listed in create new feature selection
Status: Needs review » Needs work

Few questions

1) What is calling the given hook /before/ features_include_defaults (or others [ctools for example]) include the necessary files for the hook? Ie the bug is someone is calling a hook, thus allowing module_implements to catch, before they should, as far as I can tell. I caused this scenario before via calling feature functions inside a hook_system_info_alter [which is called to in feature's ctools integration and called right as the file is added).

2) Have you verified it's also broken on the dev version?

3) If what I said in number 1 is incorrect, shouldn't the module_implements reset be inside features_include_defaults, ie when the new files are added?

4) already not already; patch 2 has that typo also

derhasi’s picture

Version: 6.x-1.1 » 6.x-1.x-dev
Component: User interface » Documentation
Category: bug » task
Status: Needs work » Needs review
StatusFileSize
new878 bytes

Oh bad, my fault. I tested this on a feature, that did not include ctools propperly (the .module missed the include_once('*.features.inc');).
So it sure works in the curent stable and dev.

Besides, The whole thing is already implemented by calling module_implements() -reset in features_include(), as long as this is called before features_include_defaults(), everything's fine. hook_system_info_alter() is not used.

So the only "issue" is the documentation thing. I corrected the misspelling and attached a clean patch to the current .dev.

damienmckenna’s picture

Bump for testbot.