4

The Standard profile declares the Node module as one of the modules it requires, and so does the Minimal profile. That is not true for the History module, which is required from the former but not the latter.

When should I declare my module as depending from a Drupal core module? Should I assume the installation profile / distribution always requires the module from which my module depends?

  • 4
    This has nothing to do with Drupal 8 specifically, this is true of Drupal 5, 6, 7, and 8. – tim.plunkett Oct 10 '13 at 5:45
7

As in all versions of Drupal, if your module depends on another module, you should always explicitly declare it as a dependency.

  • Even Node module? – user11153 Oct 10 '13 at 12:36
  • The Node module is optional in Drupal 8. – tim.plunkett Oct 10 '13 at 16:03
  • 1
    @user11153 The Node module doesn't contain required: true in node.info.yml, differently from the User module which contains that line in user.info.yml. – kiamlaluno Oct 10 '13 at 16:46

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.