Permalink
Browse files

[TwigBridge][Trans]set %count% only on transChoice

  • Loading branch information...
1 parent 78649a8 commit d176ffca512893d3c01246d9e8e3a6cb72b76962 @aitboudad aitboudad committed May 26, 2014
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/Symfony/Bridge/Twig/Node/TransNode.php
@@ -98,7 +98,7 @@ protected function compileString(\Twig_NodeInterface $body, \Twig_Node_Expressio
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());

0 comments on commit d176ffc

Please sign in to comment.