diff --git a/flavours/css.php b/flavours/css.php index ea8fa933b19..a7465090c42 100644 --- a/flavours/css.php +++ b/flavours/css.php @@ -228,17 +228,6 @@ function theme_styles_generate_and_store($theme, $rev, $themesubrev, $candidated . theme_styles_get_filename($type, $flavourid, $theme->use_svg_icons()); css_store_css($theme, $fallbacksheet, $csscontent); - // Delete older revisions from localcache. ToDo check if we can leave it cause /theme/styles.php should do it. - /*$themecachedirs = glob("{$CFG->localcachedir}/theme/*", GLOB_ONLYDIR); - foreach ($themecachedirs as $localcachedir) { - $cachedrev = []; - preg_match("/\/theme\/([0-9]+)$/", $localcachedir, $cachedrev); - $cachedrev = isset($cachedrev[1]) ? intval($cachedrev[1]) : 0; - if ($cachedrev > 0 && $cachedrev < $rev) { - fulldelete($localcachedir); - } - }*/ - // Delete older theme subrevision CSS from localcache. $subrevfiles = glob("{$CFG->localcachedir}/theme/{$rev}/{$theme->name}/css/*.css"); foreach ($subrevfiles as $subrevfile) { diff --git a/flavours/edit.php b/flavours/edit.php index 813e5707fca..193e22516d9 100644 --- a/flavours/edit.php +++ b/flavours/edit.php @@ -282,6 +282,9 @@ $fs->delete_area_files($context->id, 'theme_boost_union', 'flavours_look_favicon', $data->id); $fs->delete_area_files($context->id, 'theme_boost_union', 'flavours_look_backgroundimage', $data->id); + // Delete fallback sheet. Deleting them all because they get generated on building the all.css. + fulldelete($CFG->tempdir . '/theme/boost_union/'); + // Reset theme cache. // This is necessary as the flavour asset URLs contain the themerev. theme_reset_all_caches();