Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #27214 [HttpKernel] Fix services are no longer injected into __in…
…voke controllers method (ogizanagi) This PR was merged into the 4.1 branch. Discussion ---------- [HttpKernel] Fix services are no longer injected into __invoke controllers method | Q | A | ------------- | --- | Branch? | 4.1 <!-- see below --> | Bug fix? | yes | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #27208 <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | N/A _TL;DR:_ The `RemoveEmptyControllerArgumentLocatorsPass` is the one adding the `Controller::_invoke` => `Controller` shortcut missing from the service locator. It isn't properly executed on some cases. This fixes it. Since #26833, the resolvers are decorated by a `TraceableValueResolver`, which usually isn't much an issue to deal within passes. But the `RemoveEmptyControllerArgumentLocatorsPass` happens late (`TYPE_BEFORE_REMOVING`), when decoration inheritance is already resolved, so accessing `$controllerLocator = $container->getDefinition((string) $serviceResolver->getArgument(0));` isn't accessing the controller locator, but the decorated service instead. Commits ------- ee44903 [HttpKernel] Fix services are no longer injected into __invoke controllers method
- Loading branch information