Skip to content

Commit 168174a

Browse files
committed
bug symfony#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 | symfony#8408 | License | MIT Commits ------- d176ffc [TwigBridge][Trans]set %count% only on transChoice
2 parents 78649a8 + d176ffc commit 168174a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Bridge/Twig/Node/TransNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ protected function compileString(\Twig_NodeInterface $body, \Twig_Node_Expressio
9898
foreach ($matches[1] as $var) {
9999
$key = new \Twig_Node_Expression_Constant('%'.$var.'%', $body->getLine());
100100
if (!$vars->hasElement($key)) {
101-
if ('count' === $var) {
101+
if ('count' === $var && null !== $this->getNode('count')) {
102102
$vars->addElement($this->getNode('count'), $key);
103103
} else {
104104
$varExpr = new \Twig_Node_Expression_Name($var, $body->getLine());

0 commit comments

Comments
 (0)