mirror of
https://github.com/twigphp/Twig.git
synced 2026-08-29 19:47:06 +00:00
Merge branch '1.x' into 2.x
* 1.x: fixed "include" with "ignore missing" when an error loading occurs in the included template (again) fixed "include" with "ignore missing" when an error loading occurs in the included template
This commit is contained in:
+10
-11
@@ -187,17 +187,6 @@ class ModuleNode extends Node
|
||||
// parent
|
||||
if (!$this->hasNode('parent')) {
|
||||
$compiler->write("\$this->parent = false;\n\n");
|
||||
} elseif (($parent = $this->getNode('parent')) && $parent instanceof ConstantExpression) {
|
||||
$compiler
|
||||
->addDebugInfo($parent)
|
||||
->write('$this->parent = $this->loadTemplate(')
|
||||
->subcompile($parent)
|
||||
->raw(', ')
|
||||
->repr($this->source->getName())
|
||||
->raw(', ')
|
||||
->repr($parent->getTemplateLine())
|
||||
->raw(");\n")
|
||||
;
|
||||
}
|
||||
|
||||
$countTraits = \count($this->getNode('traits'));
|
||||
@@ -334,8 +323,18 @@ class ModuleNode extends Node
|
||||
|
||||
if ($this->hasNode('parent')) {
|
||||
$parent = $this->getNode('parent');
|
||||
|
||||
$compiler->addDebugInfo($parent);
|
||||
if ($parent instanceof ConstantExpression) {
|
||||
$compiler
|
||||
->write('$this->parent = $this->loadTemplate(')
|
||||
->subcompile($parent)
|
||||
->raw(', ')
|
||||
->repr($this->source->getName())
|
||||
->raw(', ')
|
||||
->repr($parent->getTemplateLine())
|
||||
->raw(");\n")
|
||||
;
|
||||
$compiler->write('$this->parent');
|
||||
} else {
|
||||
$compiler->write('$this->getParent($context)');
|
||||
|
||||
Reference in New Issue
Block a user