-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DependencyInjection] circular references using setter #25240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Well, you indeed have a circular reference here: you inject the strategy into the document manager, and the document manager into the strategy. This is very likely to break (writing the code able to instantiate such object graph is quite hard) |
however, having it working on 3.4 and failing on 4.0 looks weird to me. |
The difference must come from some services which have been inlined now that they are really private. |
Uhhh you are right, did not recoginze that among the code. |
@stof you got a pattern/hint for me to resolve those references? both classes need each other as it seems. both classes should be created by the DI. |
Fixed in #25247 |
This PR was merged into the 3.4 branch. Discussion ---------- [DI] Fix false-positive circular exception | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #25240 | License | MIT | Doc PR | - Commits ------- adf1819 [DI] Fix false-positive circular exception
@nicolas-grekas will you release your fix also? |
What does that mean? |
Hi,
i think i have an issue with circular references in our Symfony 4.0 build on DoctrinePhpcrBundle.
You can reproduce it it by:
(same as travis does it)
Then you can call every console command (lives in testing component, kernel is here):
You should see the issue then. Currently i do no know why? Are we doing something wrong with the service definition or is it the setter for the TranslationStrategy. When debugging into i got the following image at the end where the exception is thrown:
Notice:
The text was updated successfully, but these errors were encountered: