Skip to content

Commit

Permalink
bug #16104 Pass missing request template variables (WouterJ)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.8 branch.

Discussion
----------

Pass missing request template variables

Some render calls were missing the `request` variable, while it is used in the `layout.html.twig` template.

| Q | A
| --- | ---
| Fixed tickets | -
| License | MIT

Commits
-------

7f1b2c2 Pass missing request template variables
  • Loading branch information
fabpot committed Oct 5, 2015
2 parents 3567548 + 7f1b2c2 commit ef7aeaa
Showing 1 changed file with 5 additions and 3 deletions.
Expand Up @@ -96,7 +96,7 @@ public function panelAction(Request $request, $token)
}

if (!$profile = $this->profiler->loadProfile($token)) {
return new Response($this->twig->render('@WebProfiler/Profiler/info.html.twig', array('about' => 'no_token', 'token' => $token)), 200, array('Content-Type' => 'text/html'));
return new Response($this->twig->render('@WebProfiler/Profiler/info.html.twig', array('about' => 'no_token', 'token' => $token, 'request' => $request)), 200, array('Content-Type' => 'text/html'));
}

if (!$profile->hasCollector($panel)) {
Expand Down Expand Up @@ -140,13 +140,14 @@ public function purgeAction()
/**
* Displays information page.
*
* @param string $about The about message
* @param Request $request The current HTTP Request
* @param string $about The about message
*
* @return Response A Response instance
*
* @throws NotFoundHttpException
*/
public function infoAction($about)
public function infoAction(Request $request, $about)
{
if (null === $this->profiler) {
throw new NotFoundHttpException('The profiler must be enabled.');
Expand All @@ -156,6 +157,7 @@ public function infoAction($about)

return new Response($this->twig->render('@WebProfiler/Profiler/info.html.twig', array(
'about' => $about,
'request' => $request,
)), 200, array('Content-Type' => 'text/html'));
}

Expand Down

0 comments on commit ef7aeaa

Please sign in to comment.