From 611c7a000c3541afbd1f027efde1e1304043cbef Mon Sep 17 00:00:00 2001 From: jasondendulk Date: Tue, 16 Sep 2025 08:54:15 +1000 Subject: [PATCH] Issue #378: Add install check to before_standard_top_of_body_html_generation() --- classes/hook_callbacks.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/classes/hook_callbacks.php b/classes/hook_callbacks.php index c6688e6..6e1397b 100644 --- a/classes/hook_callbacks.php +++ b/classes/hook_callbacks.php @@ -35,6 +35,13 @@ class hook_callbacks { * @param before_standard_top_of_body_html_generation $hook */ public static function before_standard_top_of_body_html_generation(before_standard_top_of_body_html_generation $hook): void { + global $CFG; + + if (during_initial_install() || isset($CFG->upgraderunning)) { + // Do nothing during installation or upgrade. + return; + } + // Get code to inject. $hook->add_html(outagelib::get_inject_code()); }