Silently ignore if the hook does not exist

This commit is contained in:
slawkens 2023-12-28 19:12:47 +01:00
parent 687c9a6690
commit b4448f7279

View File

@ -95,7 +95,14 @@ $function = new TwigFunction('hook', function ($context, $hook, array $params =
global $hooks; global $hooks;
if(is_string($hook)) { 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; $params['context'] = $context;