Open brzuchal opened 2 years ago
Hi!
You are right, sorry I don't use doctrine (orm or dbal) myself. I guess we could remove the middleware if no manager service exists in a compiler pass.
Do you see other thing that should be handled by the middleware if only dbal is used?
I tried to play a little with doctrine bundle, if I use doctrine.orm: {}
, I still get a valid ManagerRegistry
and the middlware is working.
What version of Doctrine Bundle are you using?
@Baldinof remove doctrine.orm
from the config this is the thing, it is allowed to use only doctrine.dbal
which don't register any ManagerRegistry
I cannot reproduce your issue with the last version of doctrine bundle. There is still a registry injected, it simply does not have any entity managers, and simply provides dbal connections (which get closed / pinged if needed).
Can you try to replace this line by
->addArgument(new Reference('doctrine'))
Also, what version of doctrine bundle / symfony / roadrunner-bundle are you using?
Any news @brzuchal ?
Use of DoctrineBundle doesn't mean an ORM and any ManagerRegistry is available and yet you assume it is here https://github.com/Baldinof/roadrunner-bundle/blob/2.x/src/DependencyInjection/BaldinofRoadRunnerExtension.php#L131-L142
At a container compile time an error like this is thrown: