bug #10995 [TwigBridge][Trans]set %count% only on transChoice from the current context. (aitboudad)
This PR was merged into the 2.3 branch.
Discussion
----------
[TwigBridge][Trans]set %count% only on transChoice from the current context.
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #8408
| License | MIT
Commits
-------
d176ffc
[TwigBridge][Trans]set %count% only on transChoice
This commit is contained in:
commit
168174af08
@ -98,7 +98,7 @@ class TransNode extends \Twig_Node
|
||||
foreach ($matches[1] as $var) {
|
||||
$key = new \Twig_Node_Expression_Constant('%'.$var.'%', $body->getLine());
|
||||
if (!$vars->hasElement($key)) {
|
||||
if ('count' === $var) {
|
||||
if ('count' === $var && null !== $this->getNode('count')) {
|
||||
$vars->addElement($this->getNode('count'), $key);
|
||||
} else {
|
||||
$varExpr = new \Twig_Node_Expression_Name($var, $body->getLine());
|
||||
|
Reference in New Issue
Block a user