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
[DependencyInjection] mutated service loses its constructor arguments #23325
Comments
The code you are showing is not overwriting the service definition. It is mutating the existing definition. Overwriting the service indeed looses all constructor arguments (and also all method calls), as it replaces the whole Definition object. But this does not look like what you're doing here. to help you with your errors, I would need the stack traces too (or at least the location of the error), to know where they happen. |
OK, so the first issue is because Symfony's autowiring looked for a If you want your |
So I'm not sure, is the issue from my side because I didn't define an alias or from Symfony's side because this should work? |
Well, both. |
Ok I understand thanks for the explanation! |
The current WTF will be fixed by #23350. I guess we can close then? |
Yes, it looks like we can close this issue. Thanks! |
We have a dependency to a bundle which define this service:
We override this definition through a compiler pass:
Now when injecting the service into a controller action we get
Dnl\BackBundle\User\Registrar
Dnl\Bundle\UserBundle\Security\User\Registrar
Setter injection seems to be working except for overridden services, is there something I overlooked?
The text was updated successfully, but these errors were encountered: