Skip to content
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

[TwigBundle] properly set request attributes in controller test #12539

Merged
merged 1 commit into from
Nov 21, 2014

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented Nov 21, 2014

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

@@ -122,7 +122,7 @@ protected function findTemplate(Request $request, $format, $code, $showException
// default to a generic HTML exception
$request->setRequestFormat('html');

return new TemplateReference('TwigBundle', 'Exception', $this->debug ? 'exception_full' : $name, 'html', 'twig');
return new TemplateReference('TwigBundle', 'Exception', $name, 'html', 'twig');
Copy link
Member

Choose a reason for hiding this comment

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

this change is wrong. It won't display the full exception template in debug mode when the original format was not HTML.

However, it should use $showException, not $this->debug

Copy link
Member Author

Choose a reason for hiding this comment

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

Hm, this check is actually performed in line 103 before, isn't it? That's the reason I removed it here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, you're right about the format.

@stof
Copy link
Member

stof commented Nov 21, 2014

👍

@fabpot
Copy link
Member

fabpot commented Nov 21, 2014

Thank you @xabbuh.

@fabpot fabpot merged commit b3db574 into symfony:2.6 Nov 21, 2014
fabpot added a commit that referenced this pull request Nov 21, 2014
… test (xabbuh)

This PR was merged into the 2.6 branch.

Discussion
----------

[TwigBundle] properly set request attributes in controller test

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

b3db574 properly set request attributes in controller test
@xabbuh xabbuh deleted the fix-twig-bundle branch November 21, 2014 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants