-
Bug
-
Resolution: Fixed
-
Minor
-
4.0.7, 4.1.2, 4.2.2
In get_extra_scss_code and get_pre_scss_code (see https://github.com/moodle/moodle/blob/12a81769265a4fa75232ff1639423be1565c9fa9/lib/outputlib.php#L1591-L1612 and https://github.com/moodle/moodle/blob/12a81769265a4fa75232ff1639423be1565c9fa9/lib/outputlib.php#L1621-L1642), the theme ancestry is mixed up.
If there are four themes (boost, boost_child, boost_grandchild and boost_greatgrandchild), each with its own method in extrascsscallback and prescsscallback{}, the resulting scss code in theme designer mode contains:
/** Pre-SCSS from theme_boost_grandchild_get_pre_scss **/
/** Pre-SCSS from theme_boost_child_get_pre_scss **/
/** Pre-SCSS from theme_boost_get_pre_scss **/
/** Pre-SCSS from theme_boost_greatgrandchild_get_pre_scss **/
/** Extra SCSS from theme_boost_grandchild_get_extra_scss **/
/** Extra SCSS from theme_boost_child_get_extra_scss **/
/** Extra SCSS from theme_boost_get_extra_scss **/
/** Extra SCSS from theme_boost_greatgrandchild_get_extra_scss **/
This should probably rather be:
/** Pre-SCSS from theme_boost_get_pre_scss **/
/** Pre-SCSS from theme_boost_child_get_pre_scss **/
/** Pre-SCSS from theme_boost_grandchild_get_pre_scss **/
/** Pre-SCSS from theme_boost_greatgrandchild_get_pre_scss **/
/** Extra SCSS from theme_boost_get_extra_scss **/
/** Extra SCSS from theme_boost_child_get_extra_scss **/
/** Extra SCSS from theme_boost_grandchild_get_extra_scss **/
/** Extra SCSS from theme_boost_greatgrandchild_get_extra_scss **/
The solution for this would probably be to change
foreach ($this->parent_configs as $parent_config) {
to
foreach (array_reverse($this->parent_configs) as $parent_config) {
.