Better twig token handling

This commit is contained in:
wrenge 2024-01-11 16:06:59 +03:00
parent ba06386041
commit 648bba5560
1 changed files with 1 additions and 1 deletions

View File

@ -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',