Undefined variable $hook

My modx error log is filling up with the following:

[2023-11-07 10:50:02] (ERROR @ /www/core/cache/includes/elements/modx/revolution/modsnippet/102.include.cache.php : 48) PHP warning: Undefined variable $hook

Snippet 102 is “recaptchav2_render”

The line that is erroring is:
if ($hook) {

But I am not sure why this has started? Any ideas that can help get me back on track?

Thanks!

Probably because you updated PHP to version 8.

Apply this pull request to get rid of the warning:

1 Like

Thank you very much! This solved it. I had tried google, but had no luck.