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

Appearance settings

Commit 390cb33

Browse filesBrowse files
author
Bertalan Attila
committed
Fixing regression in TwigEngine exception handling.
1 parent 1038221 commit 390cb33
Copy full SHA for 390cb33

File tree

Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed

‎src/Symfony/Bundle/TwigBundle/TwigEngine.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/TwigEngine.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ public function render($name, array $parameters = array())
7474
if ($name instanceof TemplateReference) {
7575
try {
7676
// try to get the real name of the template where the error occurred
77-
$name = $e->getTemplateName();
78-
$path = (string) $this->locator->locate($this->parser->parse($name));
7977
if (method_exists($e, 'setSourceContext')) {
80-
$e->setSourceContext(new \Twig_Source('', $name, $path));
78+
$e->setSourceContext($e->getSourceContext());
8179
} else {
80+
$templateName = $e->getTemplateName();
81+
$path = (string) $this->locator->locate($this->parser->parse($templateName));
8282
$e->setTemplateName($path);
8383
}
8484
} catch (\Exception $e2) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.