Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
fabpot merged 1 commit intosymfony:masterfromweaverryan:controller-trait-helper
Nov 24, 2017

Conversation

@weaverryan
Copy link
Member

QA
Branch?4.0
Bug fix?no
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed ticketsnone
LicenseMIT
Doc PRnot needed

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/sessions would be pretty cool).

Copy link
Member

@javiereguiluzjaviereguiluz left a 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"');

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"?

weaverryan reacted with thumbs up emoji
{
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"');
Copy link
Member

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

Copy link
MemberAuthor

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

Copy link
Member

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 ?

Copy link
Member

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.

Copy link
Member

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.

Copy link
Contributor

@srozesrozeNov 24, 2017
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@fapbot here you go:#25151

Copy link

@20uf20uf left a 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"');
Copy link
Contributor

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
Copy link
Member

Thank you@weaverryan.

@fabpotfabpot merged commitd377b15 intosymfony:masterNov 24, 2017
fabpot added a commit that referenced this pull requestNov 24, 2017
… 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
Copy link
Member

This change is not present on the 4.0 branch. Backport needed?

@weaverryan
Copy link
MemberAuthor

Oh, maybe! If so, can you create a PR?

@chalasr
Copy link
Member

Sure#25636

fabpot added a commit that referenced this pull requestJan 3, 2018
…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
symfony-splitter pushed a commit to symfony/framework-bundle that referenced this pull requestJan 3, 2018
…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
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof left review comments

@fabpotfabpotfabpot approved these changes

@javiereguiluzjaviereguiluzjaviereguiluz approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

+3 more reviewers

@srozesrozesroze left review comments

@ro0NLro0NLro0NL approved these changes

@20uf20uf20uf approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.0

Development

Successfully merging this pull request may close these issues.

10 participants

@weaverryan@fabpot@chalasr@javiereguiluz@nicolas-grekas@stof@sroze@ro0NL@20uf@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp