Better twig token handling
This commit is contained in:
parent
ba06386041
commit
648bba5560
|
@ -77,7 +77,7 @@ function _add_twig_support(\Twig\Environment $twig)
|
|||
$twig->addFunction(new \Twig\TwigFunction('has_token',
|
||||
function($o, $token)
|
||||
{
|
||||
return $o->hasToken($token);
|
||||
return (($o instanceof \mtgMetaUnit) || ($o instanceof \mtgMetaField)) && $o->hasToken($token);
|
||||
}
|
||||
));
|
||||
$twig->addFunction(new \Twig\TwigFunction('has_token_in_parent',
|
||||
|
|
Loading…
Reference in New Issue