Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
Proposing Flex-specific error messages in the controller shortcuts#25133
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
javiereguiluz left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Really nice!
| { | ||
| if (!$this->container->has('doctrine')) { | ||
| thrownew \LogicException('The DoctrineBundle is not registered in your application.'); | ||
| thrownew \LogicException('The DoctrineBundle is not registered in your application. Try running "composer require orm"'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I'd change this one. The error message mentions something about "DoctrineBundle", but then it tells you to install a strange "orm" thing. Could we change it toTry running "composer require doctrine"?
| { | ||
| if (!$this->container->has('security.csrf.token_manager')) { | ||
| thrownew \LogicException('CSRF protection is not enabled in your application.'); | ||
| thrownew \LogicException('CSRF protection is not enabled in your application. Enable it with the "csrf_protection" key in "config/packages/framework.yaml"'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Flex should be auto-enabling it when requiring thesecurity-csrf package, no ? If yes, the right advice is to require it too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
That seems logical to me, bit I actually don't think it's enabled by default. It looks like it's always disabled unless you explicitly enable it:https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php#L107-L116
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
😢 why making FrameworkBundle auto-enable all components except one ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Looks like something we need to fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Anybody willing to submit a PR on that one? Would be cool to have it for 3.4/4.0 before final.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
8bbf48d tod377b15Compare
20uf left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Nice idea.
| { | ||
| if (!$this->container->has('security.csrf.token_manager')) { | ||
| thrownew \LogicException('CSRF protection is not enabled in your application.'); | ||
| thrownew \LogicException('CSRF protection is not enabled in your application. Enable it with the "csrf_protection" key in "config/packages/framework.yaml"'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Enable them in config/packages/framework.yaml. vs.Enable it with the "csrf_protection" key in "config/packages/framework.yaml"
always be specific/generic?
fabpot commentedNov 24, 2017
Thank you@weaverryan. |
… shortcuts (weaverryan)This PR was merged into the 4.1-dev branch.Discussion----------Proposing Flex-specific error messages in the controller shortcuts| Q | A| ------------- | ---| Branch? | 4.0| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | none| License | MIT| Doc PR | not neededThis is to help discoverability when you try to use a feature that's not installed. It's opinionated about Flex being installed, which is why this is done on 4.0.Two of the options relate to configuration. An alternative (if we don't like the short description) is to include a link instead (which could be some short URL - e.g. `http://symfony.com/docs/sessions` would be pretty cool).Commits-------d377b15 Proposing Flex-specific error messages in the controller shortcuts
chalasr commentedDec 30, 2017
This change is not present on the 4.0 branch. Backport needed? |
weaverryan commentedDec 30, 2017
Oh, maybe! If so, can you create a PR? |
chalasr commentedDec 30, 2017
Sure#25636 |
…tcuts to 3.4 (weaverryan)This PR was merged into the 3.4 branch.Discussion----------Backport Flex-specific error messages in controller shortcuts to 3.4| Q | A| ------------- | ---| Branch? | 3.4| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#25133 (comment)| License | MIT| Doc PR | n/aCommits-------419e934 Proposing Flex-specific error messages in the controller shortcuts
…tcuts to 3.4 (weaverryan)This PR was merged into the 3.4 branch.Discussion----------Backport Flex-specific error messages in controller shortcuts to 3.4| Q | A| ------------- | ---| Branch? | 3.4| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |symfony/symfony#25133 (comment)| License | MIT| Doc PR | n/aCommits-------419e93465f Proposing Flex-specific error messages in the controller shortcuts
This is to help discoverability when you try to use a feature that's not installed. It's opinionated about Flex being installed, which is why this is done on 4.0.
Two of the options relate to configuration. An alternative (if we don't like the short description) is to include a link instead (which could be some short URL - e.g.
http://symfony.com/docs/sessionswould be pretty cool).