diff --git a/src/codegen.inc.php b/src/codegen.inc.php index b3b424b..7a5ffe2 100644 --- a/src/codegen.inc.php +++ b/src/codegen.inc.php @@ -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',