Support installing dependent contrib modules

Created on 7 August 2023, over 1 year ago
Updated 9 August 2023, over 1 year ago

Problem/Motivation

Modules dependent on non-core modules, (specified in the `project:subproject` format in the module's .info.yml) cannot be enabled using `Drupal\Tests\test_support\Traits\Installs\InstallsModules::installModuleWithDependencies()`

Steps to reproduce

Attempt to enable a module with such a reference.

It presently fails with an "Undefined index: [project]:[subproject]" exception (where `[project]:[subproject]` corresponds to the non-core dependency).

Proposed resolution

Expand the logic (https://git.drupalcode.org/project/test_support/-/blob/0d5489896b1462bd0...) to be aware that prefixes other than `drupal:` are expected.

Would it be possible/make sense to make use of the `InfoParser` service, or one of its underlying classes?: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Extension...

Remaining tasks

User interface changes

None.

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇨🇦Canada adam-vessey PE, Canada

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @adam-vessey
  • 🇬🇧United Kingdom aidenbradley

    Hi Adam,

    Thanks for trying out the module!

    I've pushed all the up to date code to the `1.0.x-dev` branch, which includes using the `Drupal\Core\Extension\Dependency` value object in core to determine the dependency.

    Hopefully now the module is aware of more than just the `drupal:` prefix!

    Let me know how you get on.

    Thanks!

  • 🇬🇧United Kingdom aidenbradley

    Hi Adam,

    Thanks for trying out the module!

    I've pushed all the up to date code to the `1.0.x-dev` branch, which includes using the `Drupal\Core\Extension\Dependency` value object in core to determine the dependency.

    Hopefully now the module is aware of more than just the `drupal:` prefix!

    Let me know how you get on.

    Thanks!

  • 🇮🇳India Shreya_98

    Added dependencies successfully in yml file .Kindly review the patch file.

Production build 0.71.5 2024