From 68d87e3a845e36eed17d3d3815a0bcfe5bc322f0 Mon Sep 17 00:00:00 2001 From: Shish Date: Tue, 18 Jun 2024 17:02:36 +0100 Subject: [PATCH] [setup] have ConfigSaveEvent save the config --- ext/setup/main.php | 6 +----- ext/user_config/main.php | 1 - 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/ext/setup/main.php b/ext/setup/main.php index 3d001128..2af0b490 100644 --- a/ext/setup/main.php +++ b/ext/setup/main.php @@ -344,7 +344,6 @@ class Setup extends Extension $this->theme->display_page($page, $panel); } elseif ($event->page_matches("setup/save", method: "POST", permission: Permissions::CHANGE_SETTING)) { send_event(new ConfigSaveEvent($config, $event->POST)); - $config->save(); $page->flash("Config saved"); $page->set_mode(PageMode::REDIRECT); $page->set_redirect(make_link("setup")); @@ -407,11 +406,8 @@ class Setup extends Extension } } } + $config->save(); log_warning("setup", "Configuration updated"); - foreach (\Safe\glob("data/cache/*.css") as $css_cache) { - unlink($css_cache); - } - log_warning("setup", "Cache cleared"); } public function onCliGen(CliGenEvent $event): void diff --git a/ext/user_config/main.php b/ext/user_config/main.php index d3802d5b..37c24a9d 100644 --- a/ext/user_config/main.php +++ b/ext/user_config/main.php @@ -149,7 +149,6 @@ class UserConfig extends Extension $target_config = UserConfig::get_for_user($duser->id); send_event(new ConfigSaveEvent($target_config, $event->POST)); - $target_config->save(); $page->flash("Config saved"); $page->set_mode(PageMode::REDIRECT); $page->set_redirect(make_link("user_config"));