- Issue created by @djdevin
Module classes are not in the container or autoloaded if the module is not installed so I think this is to be expected? Does module2 depend on module1 in its info.yml file?
- πΊπΈUnited States djdevin Philadelphia
Yes, the dependencies are setup correctly (mod1 depends on mod2).
On a fresh install it works fine, issue seems to be introducing autowiring during an update - seems to be no way I can get the module enabled in time before that error throws.
You may have to write a service factory class in module1 to dynamically load the new dependency if available or else do something else. I don't know whether this can be "fixed" as if it is a bug.
- π³πΏNew Zealand quietone
Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies β .
- π¬π§United Kingdom catch
There's some amount of support for optional dependencies in the container, see https://symfony.com/doc/current/service_container/optional_dependencies....
I'm not sure exactly if/how this is supported with autowiring, but you might be able to do that, then make the service non-optional once you can ensure that every site has updated to the version with the new dependency.