1

I have a new module moduleB. It defines a service that is used in the dependency injection of moduleA.

moduleA is already enabled, its changes are just to the services definition. The info.yml has moduleB as a dependency.

Both moduleA and moduleB are in the core.extension config to be enabled.

moduleB cannot be enabled using config (cim or csim) because the missing dependency from moduleA throws an exception.

How can I get config to enable the missing module before checking the service dependency? Or, how can I restructure to allow the existing module to use the new module service to allow enabling the module through drush ?

Thanks!

1 Answer 1

0

You can add moduleA to core.extension.yml on a new line (with the other modules) as module_a: 0.

10
  • Thanks, thats already done.
    – Christian
    Commented Mar 30, 2021 at 2:36
  • Try just enabling the module first manually: drush en module_b; drush cim.
    – Jaypan
    Commented Mar 30, 2021 at 3:11
  • Thanks for the reply but that defeats the purpose of the config system. I want to manage this through config so we can utilise CI. Its also worth noting that this also throws the same error. The only way to fix at the moment is to comment out the arguments in services yml
    – Christian
    Commented Mar 30, 2021 at 3:31
  • I might be wrong, but I vaguely remember reading this is a security measure, requiring modules to be manually enabled, as allowing them to be automatically enabled could allow for the insertion of malicious modules.
    – Jaypan
    Commented Mar 30, 2021 at 5:40
  • 4
    The module needs to be enabled in hook_update_N() function @Christian. This is why the recommended deployment workflow is drush updb; drush cr; drush cim, so that update hooks can resolve these potential inconsistencies in config
    – Clive
    Commented Mar 30, 2021 at 12:27

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.