From eae7f9deb7a9a90b2d57a1de6b879130f1d1bb7b Mon Sep 17 00:00:00 2001 From: Daniel Poggenpohl Date: Thu, 16 Mar 2023 13:31:34 +0100 Subject: [PATCH 1/3] MDL-77657 theme: Fix get_extra_scss_code load order This led to problems with grandchild themes, depending on their direct parent's extrascsscallback. --- lib/outputlib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/outputlib.php b/lib/outputlib.php index 37dc3c47eb3..0742a6e31bf 100644 --- a/lib/outputlib.php +++ b/lib/outputlib.php @@ -1625,7 +1625,7 @@ class theme_config { // Getting all the candidate functions. $candidates = array(); - foreach ($this->parent_configs as $parent_config) { + foreach (array_reverse($this->parent_configs) as $parent_config) { if (!isset($parent_config->extrascsscallback)) { continue; } From d98766494feb58bba7653a9f7006cc6716aa6ff4 Mon Sep 17 00:00:00 2001 From: Daniel Poggenpohl Date: Mon, 20 Mar 2023 08:50:41 +0100 Subject: [PATCH 2/3] MDL-77657 theme: Fix get_pre_scss_code load order This led to problems with grandchild themes, depending on their direct parent's prescsscallback. --- lib/outputlib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/outputlib.php b/lib/outputlib.php index 0742a6e31bf..bcc6eaf7960 100644 --- a/lib/outputlib.php +++ b/lib/outputlib.php @@ -1658,7 +1658,7 @@ class theme_config { // Getting all the candidate functions. $candidates = array(); - foreach ($this->parent_configs as $parent_config) { + foreach (array_reverse($this->parent_configs) as $parent_config) { if (!isset($parent_config->prescsscallback)) { continue; } From f3c5b84da394977d8d06367ab8a0378b5f6f91af Mon Sep 17 00:00:00 2001 From: Daniel Poggenpohl Date: Tue, 4 Apr 2023 15:50:18 +0200 Subject: [PATCH 3/3] MDL-77657 theme: Corrected return type --- theme/boost/lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/theme/boost/lib.php b/theme/boost/lib.php index 7e98100f6d8..6cc398d535e 100644 --- a/theme/boost/lib.php +++ b/theme/boost/lib.php @@ -135,7 +135,7 @@ function theme_boost_get_precompiled_css() { * Get SCSS to prepend. * * @param theme_config $theme The theme config object. - * @return array + * @return string */ function theme_boost_get_pre_scss($theme) { global $CFG;