From b4448f72799e43b779daa3c4c9bac6caa4f87ad3 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 0222353a..12189638 100644 --- a/system/twig.php +++ b/system/twig.php @@ -95,7 +95,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;