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

[TwigBundle] Fix error page preview for custom twig.exception_controller#12147

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

Closed
mpdude wants to merge2 commits intosymfony:masterfromwebfactory:fix-error-page-preview
Closed

[TwigBundle] Fix error page preview for custom twig.exception_controller#12147

mpdude wants to merge2 commits intosymfony:masterfromwebfactory:fix-error-page-preview

Conversation

@mpdude
Copy link
Contributor

QA
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#12147
LicenseMIT
Doc PRn/a

ThetestErrorPageAction() always used theshowAction() of TwigBundle'sExceptionController.
You can, however, configure an alternate controller by settingtwig.exception_controller.

Thus, in order to get a proper preview, we need to forward to this configured controller (which
may be the default one).

This requires us to pass an additional parameter toExceptionController::showAction to be able to
get theerror page even if configured otherwise in the constructor.

(The other approach would have been to fiddle around withExceptionController'sdebug flag through a setter when going through the preview action, but that would have been even more messy.)

@mpdudempdude changed the title[TwigBundle] Fix that error page preview does not work for custom twig.exception_controller[TwigBundle] Fix error page preview for custom twig.exception_controllerOct 6, 2014
…g.exception_controllerThe testErrorPageAction() always used the showAction() of TwigBundle's ExceptionController.You can, however, configure an alternate controller by setting twig.exception_controller.Thus, in order to get a proper preview, we need to forward to this configured controller (whichmay be the default one).This requires us to pass an additional parameter to ExceptionController::showAction to be able toget the *error* page even if configured otherwise in the constructor.
weaverryan added a commit to symfony/symfony-docs that referenced this pull requestOct 19, 2014
This PR was merged into the master branch.Discussion----------Document error page preview (Symfony ~2.6)This adds documentation how to use the new preview feature fromsymfony/symfony#12096 (and hopefully the fix insymfony/symfony#12147).Commits-------d02c7c4 Updates according to GH feedback8e70373 Document error page preview in Symfony ~2.6 (#4293)
@lyrixx
Copy link
Member

@mpdude In your PR description, the link to "Fixed tickets" targetsthis PR.

@mpdude
Copy link
ContributorAuthor

Yes,this is the issue that describes the problem an provides a fix for it. Should I do it differently...?

Copy link
Contributor

Choose a reason for hiding this comment

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

bc break

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Right. Is that an issue even if it is not@api?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, we try to avoid Bc breaks whenever possible. So, the old name should be kept.

@mpdude
Copy link
ContributorAuthor

If I am not missing anything, this should be 100% BC now.

Copy link
Member

Choose a reason for hiding this comment

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

For others, this method was introduced in 2.6, so removing it is not a BC break.

Copy link
Member

Choose a reason for hiding this comment

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

but only if we merge this before making 2.6 stable

@fabpot
Copy link
Member

👍

Copy link
Member

Choose a reason for hiding this comment

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

should be$request->attributes->get('showException' actually

@stof
Copy link
Member

Except for the change I requested above, this is fine for me

@fabpot
Copy link
Member

Thank you@mpdude.

fabpot added a commit that referenced this pull requestNov 21, 2014
…ption_controller (mpdude)This PR was submitted for the master branch but it was merged into the 2.6 branch instead (closes#12147).Discussion----------[TwigBundle] Fix error page preview for custom twig.exception_controller| Q             | A| ------------- | ---| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#12147| License       | MIT| Doc PR        | n/aThe `testErrorPageAction()` always used the `showAction()` of TwigBundle's `ExceptionController`.You can, however, configure an alternate controller by setting `twig.exception_controller`.Thus, in order to get a proper preview, we need to forward to this configured controller (whichmay be the default one).This requires us to pass an additional parameter to `ExceptionController::showAction` to be able toget the *error* page even if configured otherwise in the constructor.(The other approach would have been to fiddle around with `ExceptionController`'s `debug` flag through a setter when going through the preview action, but that would have been even more messy.)Commits-------2065e00 [TwigBundle] Fix error page preview for custom twig.exception_controller
@fabpot
Copy link
Member

I've fixed the comment from@stof in7bb1abe

@fabpotfabpot closed thisNov 21, 2014
@fabpot
Copy link
Member

@mpdude Actually, that breaks tests :( Can you have a look at the problems?https://travis-ci.org/symfony/symfony/jobs/41700375

@mpdude
Copy link
ContributorAuthor

It’s the change in7bb1abe that@stof requested.

Is the way Iset up the request wrong?

That parameter does not show up in$request->attributes.

@xabbuh
Copy link
Member

@mpdude Can you have a look at#12539?

@stof
Copy link
Member

hmm yeah, you are creating the request with a query string setting, not an attribute (so you are not testing the same thing than what the preview controller uses)

@mpdude
Copy link
ContributorAuthor

Fix (at least for one issue) is in#12541.

@mpdude
Copy link
ContributorAuthor

Where can I find more about the different semantics of Request::get and Request::$attribtues and when to use which?

@xabbuh
Copy link
Member

@mpdude
Copy link
ContributorAuthor

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

7 participants

@mpdude@lyrixx@fabpot@stof@xabbuh@GromNaN@Tobion

[8]ページ先頭

©2009-2025 Movatter.jp