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
DI: Explain the controller.service_arguments changes #7988
Comments
Hi, I have the same issue, and it doesn't fix it when i register my controller as a service.
|
You did not put it as I wrote it :) - tags:
- - name: controller.service_arguments
+ tags: ['controller.service_arguments'] |
Yeah I know but it didn't work when il write it this way. I got an error saying that a "tags" entry should be an array |
@Stormkirk Please open an issue at https://github.com/symfony/symfony if you are using Symfony 3.3 and this doesn't work for you with some steps on how to reproduce your issue. |
I'm not usine symfony 3.3 but 3.2.4 |
Well, the short notation for tags is a new feature of Symfony 3.3. And the |
@xabbuh https://symfony.com/doc/current/service_container.html . So i'm using symfony 3.3.9 with documentation 3.3 and if one follows the documentation example doesn't work. The "controller.service_arguments" is under the second-last paragraph "Importing Many Services at once with resource" 👎 |
@max4ever Can you show an example project with the changes that you did and that were not working for you? |
I'm writing post about this feature but could not find it. Found something in commit: cbedd79, but not in the docs (probably moved/deleted in master now) And something like this is too vague: https://symfony.com/doc/current/service_container/3.3-di-changes.html#controllers-are-registered-as-services |
symfony/symfony#30569 helps |
…message when a controller fails because it's not registered as a service (moynzzz) This PR was squashed before being merged into the 4.3-dev branch (closes #30569). Discussion ---------- [FrameworkBundle][HttpKernel] Provide intuitive error message when a controller fails because it's not registered as a service | Q | A | ------------- | --- | Branch? | master <!-- see below --> | Bug fix? | no | New feature? | yes <!-- 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 | #27787, symfony/symfony-docs#7988 <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | none <!-- required for new features --> <!-- Write a short README entry for your feature/bugfix here (replace this comment block.) This will help people understand your PR and can be used as a start of the Doc PR. Additionally: - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. --> Create a very late controller argument value resolver to throw an intuitive error message when controller fails because it is not registered as a service. Commits ------- fbfc623b72 [FrameworkBundle][HttpKernel] Provide intuitive error message when a controller fails because it's not registered as a service
…message when a controller fails because it's not registered as a service (moynzzz) This PR was squashed before being merged into the 4.3-dev branch (closes #30569). Discussion ---------- [FrameworkBundle][HttpKernel] Provide intuitive error message when a controller fails because it's not registered as a service | Q | A | ------------- | --- | Branch? | master <!-- see below --> | Bug fix? | no | New feature? | yes <!-- 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 | #27787, symfony/symfony-docs#7988 <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | none <!-- required for new features --> <!-- Write a short README entry for your feature/bugfix here (replace this comment block.) This will help people understand your PR and can be used as a start of the Doc PR. Additionally: - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. --> Create a very late controller argument value resolver to throw an intuitive error message when controller fails because it is not registered as a service. Commits ------- fbfc623 [FrameworkBundle][HttpKernel] Provide intuitive error message when a controller fails because it's not registered as a service
…message when a controller fails because it's not registered as a service (moynzzz) This PR was squashed before being merged into the 4.3-dev branch (closes #30569). Discussion ---------- [FrameworkBundle][HttpKernel] Provide intuitive error message when a controller fails because it's not registered as a service | Q | A | ------------- | --- | Branch? | master <!-- see below --> | Bug fix? | no | New feature? | yes <!-- 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 | #27787, symfony/symfony-docs#7988 <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | none <!-- required for new features --> <!-- Write a short README entry for your feature/bugfix here (replace this comment block.) This will help people understand your PR and can be used as a start of the Doc PR. Additionally: - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. --> Create a very late controller argument value resolver to throw an intuitive error message when controller fails because it is not registered as a service. Commits ------- fbfc623 [FrameworkBundle][HttpKernel] Provide intuitive error message when a controller fails because it's not registered as a service
I'm closing this issue because I think the current docs are enough ... and the improved error messages in Symfony perfectly explain what is happening and how to solve it. Thanks. |
The 3.3 version of the docs assume that the reader uses a Standard Edition based on the config we provide for Symfony 3.3 or uses Symfony Flex where you get the same config. However, someone having an existing application that was just upgraded to Symfony 3.3 does not have all controllers registered as services. We should think about how we could improve understanding for them to avoid confusions like in symfony/symfony#23033.
The text was updated successfully, but these errors were encountered: