3

I have just created a Feature that has about 10 module dependencies. I installed the feature on the target Drupal instance, and discovered that the dependencies were not included in the feature tarball. Is there a way to tell features to package dependency modules into the feature so that they will get installed along with the feature? Or am I misunderstanding what the features module is supposed to do?

4

I think the latter is true, and you're misunderstanding what Features does.

Features takes any database-stored configuration (Views for example), and exports it to code. The generated module is essentially just a package that then contains the code version of your configuration.

For example, if you create a Feature containing a Blog content type, and a View that show all Blog articles in a list - the generated Feature is simply a module with that configuration stored in code, and exposed to Drupal.

If you want all of the modules packaged, you are looking more towards a distribution - which is a completely different kettle of fish.

To cut a long answer short, Features is a module builder - so as with any other module, dependencies must be retrieved seperately.

  • Ok, that makes sense. What I don't get then is the following: when creating the feature, I am shown a handy list of all module dependencies. But if these modules are not enabled on the target system when the feature is installed, then the feature install is semi-pointless, and there's no system feedback to reflect that fact. – ted.strauss Oct 12 '12 at 19:49
  • 1
    I think you are missing the point of features. A feature is a module. It will not allow you to enable it until it's other module dependencies are downloaded too. Just like you cannot enable views until you download and install ctools (Does this make views "semi-pointless"?). if you want something that goes and fetches it dependecies automatically then create an app drupal.org/project/apps Read more about apps at chocolatelilyweb.ca/blog/… – user842 Oct 12 '12 at 23:52
  • I think my confusion around the 'semi-pointless' comment is that the features UI shows how fields, views, etc configurations are packaged into the feature, but the module dependencies are shown as a list. So I was under the impression that those dependencies were somehow packaged, but now I understand they are not. Thanks for the help. I hope this can help someone else. – ted.strauss Oct 15 '12 at 16:39
0

This may be a bit late, but if you are using drush (the command line Drupal tool), the dependent modules will be downloaded when you enable the feature.

So if you have a feature called "MyFeat" which is dependent on modules A, B and C, you can copy the MyFeat folder to the target site (at sites/all/modules). Then from the websites/myDrupalSite directory, run the command "drush en MyFeat". Drush will detect the dependencies and ask if you want to download A, B and C.

May be not as elegant as Distros or Apps, but works for me and hope this helps you as well.

Alan

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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