Commit 962122ef authored by catch's avatar catch

Issue #2884675 by rodrigoaguilera, joelpittet, TR: Remove twig uses of...

Issue #2884675 by rodrigoaguilera, joelpittet, TR: Remove twig uses of Twig_Node::getLine to Twig_Node::getTemplateLine
parent 93b9f584
......@@ -157,7 +157,7 @@ protected function compileString(\Twig_Node $body) {
if (!is_null($args)) {
$argName = $args->getAttribute('name');
}
$expr = new \Twig_Node_Expression_Name($argName, $n->getLine());
$expr = new \Twig_Node_Expression_Name($argName, $n->getTemplateLine());
}
$placeholder = sprintf('%s%s', $argPrefix, $argName);
$text .= $placeholder;
......@@ -176,7 +176,10 @@ protected function compileString(\Twig_Node $body) {
$text = $body->getAttribute('data');
}
return [new \Twig_Node([new \Twig_Node_Expression_Constant(trim($text), $body->getLine())]), $tokens];
return [
new \Twig_Node([new \Twig_Node_Expression_Constant(trim($text), $body->getTemplateLine())]),
$tokens,
];
}
}
......@@ -33,7 +33,7 @@ protected function doLeaveNode(\Twig_Node $node, \Twig_Environment $env) {
return $node;
}
$class = get_class($node);
$line = $node->getLine();
$line = $node->getTemplateLine();
return new $class(
new \Twig_Node_Expression_Function('render_var', new \Twig_Node([$node->getNode('expr')]), $line),
$line
......@@ -46,7 +46,8 @@ protected function doLeaveNode(\Twig_Node $node, \Twig_Environment $env) {
// Use our own escape filter that is SafeMarkup aware.
$node->getNode('filter')->setAttribute('value', 'drupal_escape');
// Store that we have a filter active already that knows how to deal with render arrays.
// Store that we have a filter active already that knows
// how to deal with render arrays.
$this->skipRenderVarFunction = TRUE;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment