Closed rask closed 3 years ago
I encountered the same problem with symfony = 4.4.8
and orm-pack =1.0.8
versions.
orm-pack has internal doctrine/doctrine-bundle dependency which resolved at version 1.11.2
I managed to solve the problem by adding the following doctrine-bundle dependency to composer.json "doctrine/doctrine-bundle": "^1.12"
This should be fixed now.
I ran into this issue today when I upgraded one of our Symfony 4.2 applications to run on PHP 7.4 and updated dependencies accordingly.
In the
composer.json
we havesymfony/orm-pack
installed, which installsdoctrine/doctrine-bundle
properly at version1.12.*
or so.We also have
DoctrineBundle
defined inconfig/bundles.php
properly.Otherwise the application worked OK in PHP 7.4 and new dependencies, but I noticed that one of our controllers was throwing errors that displayed:
After digging, I noticed that the bundle was in fact registered when running
console debug:container
.ManagerRegistry
instances were properly injected when passed in as constructor parameters, so it seemed to work.What was different with the failing controller, was that it used
$this->getDoctrine()
instead of injecting aManagerRegistry
. The controller extends Symfony'sAbstractController
.The problem went away when I swapped the
getDoctrine()
call to be aManagerRegistry
injection instead.I do think that this has something to do with a relatively stale Symfony 4.2 being in use, but wanted to post this issue to