Skip to content

Commit

Permalink
moodle-an-hochschulen#155 Added removing of flavour fallback sheet.
Browse files Browse the repository at this point in the history
  • Loading branch information
mwehr committed Jul 19, 2023
1 parent 860471e commit 94a3eab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
11 changes: 0 additions & 11 deletions flavours/css.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 3 additions & 0 deletions flavours/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 94a3eab

Please sign in to comment.