From ef659d0584af90469d72889e6081d7901f4de4c7 Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Fri, 12 May 2023 15:05:12 +0100 Subject: [PATCH] MDL-78055 themes: account for undefined extrascsscallback config. Where a theme didn't define this property, it would raise debugging deprecation warnings in PHP8.1. --- lib/outputlib.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/outputlib.php b/lib/outputlib.php index 1bbd202dfd2..dab6f7c7ed2 100644 --- a/lib/outputlib.php +++ b/lib/outputlib.php @@ -1599,7 +1599,10 @@ class theme_config { } $candidates[] = $parent_config->extrascsscallback; } - $candidates[] = $this->extrascsscallback; + + if (isset($this->extrascsscallback)) { + $candidates[] = $this->extrascsscallback; + } // Calling the functions. foreach ($candidates as $function) { @@ -1629,7 +1632,10 @@ class theme_config { } $candidates[] = $parent_config->prescsscallback; } - $candidates[] = $this->prescsscallback; + + if (isset($this->prescsscallback)) { + $candidates[] = $this->prescsscallback; + } // Calling the functions. foreach ($candidates as $function) {