From 648bba556084f901f13c4864dffdc40e751a455a Mon Sep 17 00:00:00 2001 From: wrenge Date: Thu, 11 Jan 2024 16:06:59 +0300 Subject: [PATCH] Better twig token handling --- src/codegen.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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',