Un-Featuring a Feature module

Last updated on
23 December 2016

Drupal 7 will no longer be supported after January 5, 2025. Learn more and find resources for Drupal 7 sites

Features module exports configuration as modules, but these modules are a bit "special" in that they don't contain hooks like regular modules for things like node types and permissions, but instead, the hooks are called on behalf of the module by Features module itself through a series of includes in its /includes directory.

If you want to undo this and make your feature module behave like a real module, here's what's involved, using the Features Tests module (included with the Features module) as the test case.

- Remove the hidden = TRUE entry from the feature module's info file. Now you can see it in the modules listing.
- Remove the Features and Strongarm dependencies, so we can fall back to normal things.

CTools Exportables (Views, Panels, etc.)

Thanks to features_test.features.inc, which is automatically included by the .module file, any CTools exportables (e.g. Views) will automatically appear without you having to do anything. Hooray!

Content types

Any content types defined by your feature will also automatically show up. Hooray! The Fields on those are a bit of a different matter, unfortunately. ;)

Fields, Filters, Taxonomy Vocabularies, User Permissions, etc.

TODO. Because Drupal core doesn't support exporting of these things, Features module wraps them in CTools exportable. Unfortunately, without Features module, CTools doesn't know how to pick these things up. This might just be a matter of some naming conventions; not sure.

Variables

TODO. Strongarm hurts my brain.

features[] entries in .info file

TODO. Figure out what to do with these:

features[ctools][] = strongarm:strongarm:1
features[ctools][] = views:views_default:3.0
features[features_api][] = api:1
features[field][] = node-features_test-field_features_test
features[filter][] = features_test
features[image][] = features_test
features[node][] = features_test
features[taxonomy][] = taxonomy_features_test
features[user_permission][] = create features_test content
features[views_view][] = features_test

They are called during hook_module_enable/disable to fire the right stuff in the right places.

Help improve this page

Page status: No known problems

You can: