From e26e6f3a1c309bb90d321171312ebc37d04d329b Mon Sep 17 00:00:00 2001 From: slawkens Date: Thu, 28 Dec 2023 19:12:47 +0100 Subject: [PATCH] Silently ignore if the hook does not exist --- system/twig.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/system/twig.php b/system/twig.php index bc843001..45f43ef5 100644 --- a/system/twig.php +++ b/system/twig.php @@ -48,7 +48,14 @@ $function = new TwigFunction('hook', function ($context, $hook, array $params = global $hooks; if(is_string($hook)) { - $hook = constant($hook); + if (defined($hook)) { + $hook = constant($hook); + } + else { + // plugin/template has a hook that this version of myaac does not support + // just silently return + return; + } } $params['context'] = $context;