Skip to content

Commit

Permalink
Fixed Moodle install error by renaming trema.scss to default.scss.
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-milette committed Apr 23, 2024
1 parent 2ec01ad commit 1acc5bd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
9 changes: 8 additions & 1 deletion db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,14 @@ function xmldb_theme_trema_upgrade($oldversion): bool {
}
}

upgrade_plugin_savepoint(true, 2024040100, 'theme', 'trema');
if ($oldversion < 2024042300) {
// Renamed trema.scss to default.scss.
if (get_config('theme_trema', 'preset') == 'trema.scss') {
set_config('preset', 'default.scss', 'theme_trema');
}
}

upgrade_plugin_savepoint(true, 2024042300, 'theme', 'trema');
}

return true;
Expand Down
2 changes: 1 addition & 1 deletion lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ function theme_trema_get_main_scss_content($theme) {

$scss = '';

$filename = !empty($theme->settings->preset) ? $theme->settings->preset : 'trema.scss';
$filename = !empty($theme->settings->preset) ? $theme->settings->preset : 'default.scss';
$scss .= file_get_contents("$CFG->dirroot/theme/trema/scss/preset/{$filename}");

if (!empty($theme->settings->enabletrematopics)) {
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions settings/general_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
$name = 'theme_trema/preset';
$title = get_string('preset', 'theme_boost');
$description = get_string('preset_desc', 'theme_boost');
$default = 'trema.scss';
$default = 'default.scss';
// These are the built in presets.
$choices = ['trema.scss' => 'trema.scss', 'plain.scss' => 'plain.scss'];
$choices = ['default.scss' => 'default.scss', 'plain.scss' => 'plain.scss'];
$setting = new admin_setting_configthemepreset($name, $title, $description, $default, $choices, 'trema');
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
Expand Down

0 comments on commit 1acc5bd

Please sign in to comment.