So I looked at the features API, and in order to enable a feature, they use this code:

function hook_pre_features_enable_feature($component){

So I go in and add this:

function mysite_pre_features_enable_feature($component){
    $component = 'roles';

My Feature is already there, but it never gets enabled. Why is this?


1 Answer 1


in order to enable a feature, they use this code

That's not accurate. The hook function is actually:

Invoked on a Feature module before that module is enabled.

It's not involved with the action of enabling the feature, it's just a listener to enable it to run some code just before something else enables it.

Features are just modules, and to enable one you use the same method as if you were just enabling a module:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.