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!

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 Mar 30 at 2:36
  • Try just enabling the module first manually: drush en module_b; drush cim. – Jaypan Mar 30 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 Mar 30 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 Mar 30 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 Mar 30 at 12:27

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.