8000 Make twig ExceptionController conformed with ExceptionListener by megazoll · Pull Request #11904 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Make twig ExceptionController conformed with ExceptionListener #11904

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

Closed
wants to merge 1 commit into from

Conversation

megazoll
Copy link
Contributor
Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #9083
License MIT
Doc PR

Parameter passed to exception controller from exception listener called format, so variable _format in exception controller always takes default value.
https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php#L120

@Tobion
Copy link
Contributor
Tobion commented Sep 11, 2014

Probably related to #9083

@megazoll megazoll force-pushed the twig-exception-controller branch from a6a3c32 to 48b66bf Compare September 11, 2014 15:55
@megazoll
Copy link
Contributor Author

I'm fully agreed with @stof. Removed $_format parameter.

@Tobion
Copy link
Contributor
Tobion commented Sep 11, 2014

big 👍 should probably be merged into older branches. it fixes #9083

@stof
Copy link
Member
stof commented Sep 12, 2014

looks good to me

@Tobion
Copy link
Contributor
Tobion commented Sep 12, 2014

@stof which branch should it be merged?

@stof
Copy link
Member
stof commented Sep 12, 2014

given that it is a bug fix, I would vote for 2.3. Let's see whether @fabpot agrees with that

*
* @return Response
*
* @throws \InvalidArgumentException When the exception template does not exist
*/
public function showAction(Request $request, FlattenException $exception, DebugLoggerInterface $logger = null, $_format = 'html')
public function showAction(Request $request, FlattenException $exception, DebugLoggerInterface $logger = null)
Copy link
Member

Choose a reason for hiding this comment

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

This needs to be kept for BC reasons even if we are not using it anymore.

Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure, under which circumstance is this 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.

People extending this class.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think it can break bc: http://3v4l.org/BNIhV

Copy link
Member

Choose a reason for hiding this comment

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

This is the other way around: http://3v4l.org/MW2C2

Copy link
Contributor

Choose a reason for hiding this comment

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

But this way it's not possible to be used.

Copy link
Member

Choose a reason for hiding this comment

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

why the other way around ? If someone extends the class currently, updating Symfony will end up with their class adding an optional parameter, not removing it. This means that this will be the case of @Tobion. the TwigBundle class is the parent, not the child

Copy link
Member

Choose a reason for hiding this comment

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

@stof sure, I realized my mistake and that's why I merged this PR.

@fabpot
Copy link
Member
fabpot commented Sep 24, 2014

Except for the BC break that should be reverted, I'm 👍

@fabpot
Copy link
Member
fabpot commented Sep 24, 2014

Thank you @megazoll.

fabpot added a commit that referenced this pull request Sep 24, 2014
…ener (megazoll)

This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #11904).

Discussion
----------

Make twig ExceptionController conformed with ExceptionListener

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

Parameter passed to exception controller from exception listener called ``format``, so variable ``_format`` in exception controller always takes default value.
https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php#L120

Commits
-------

24c5ba4 Use request format from request in twig ExceptionController
@fabpot fabpot closed this Sep 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0