-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Conversation
Probably related to #9083 |
a6a3c32
to
48b66bf
Compare
I'm fully agreed with @stof. Removed |
big 👍 should probably be merged into older branches. it fixes #9083 |
looks good to me |
@stof which branch should it be merged? |
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) |
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.
This needs to be kept for BC reasons even if we are not using it anymore.
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.
Not sure, under which circumstance is this a bc break?
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.
People extending this class.
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 don't think it can break bc: http://3v4l.org/BNIhV
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.
This is the other way around: http://3v4l.org/MW2C2
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.
But this way it's not possible to be used.
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 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
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.
@stof sure, I realized my mistake and that's why I merged this PR.
Except for the BC break that should be reverted, I'm 👍 |
Thank you @megazoll. |
…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
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