0

Running phpcs --standard=DrupalPractice in several modules *.info.yml file I get a warning message:

All dependencies must be prefixed with the project name

I've seen some modules that use the module name as prefix

dependencies:
  - modulename:modulename
  - modulename:submodulename

Others when it belongs to Drupal core:

dependencies:
  - drupal:modulename_already_in_core

Others when it belongs to always Drupal (doesn't taking into account if the module is in the core or not):

dependencies:
  - drupal:modulename

Which is the right syntax? Should I use "drupal" always? Just when the module is in Drupal (core)? What is the aim of this requirement?

Thanks!

More info: https://www.drupal.org/project/coder/issues/2854781

1

As described in Let Drupal 8 know about your module with an .info.yml file, the correct format is:

  • project-name:module-name for third-party modules
  • drupal:module-name for a core module

Dependencies should be namespaced in the format: {project}:{module} where {project} is the project name as it appears in the Drupal.org URL (e.g. drupal.org/project/views) and {module} is the module's machine name.

Since the project page for Drupal core is https://www.drupal.org/project/drupal, the case for Drupal core modules is the same as for third-party modules.

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.