From 4bcbda64d6d1cf6c61fdb7ac611b27ea40312866 Mon Sep 17 00:00:00 2001 From: Beu Date: Fri, 8 Sep 2023 21:23:47 +0200 Subject: [PATCH] fix clearstorage at start --- core/Settings/SettingManager.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/core/Settings/SettingManager.php b/core/Settings/SettingManager.php index 04833d21..a6eaa681 100644 --- a/core/Settings/SettingManager.php +++ b/core/Settings/SettingManager.php @@ -125,7 +125,8 @@ class SettingManager implements CallbackListener, UsageInformationAble { * Handle After Init Callback */ public function handleAfterInit() { - $this->disableCache = $this->getSettingValue($this, self::SETTING_DISABLE_SETTING_CACHE); + $this->disableCache = boolval($this->getSettingValue($this, self::SETTING_DISABLE_SETTING_CACHE)); + if ($this->disableCache) $this->clearStorage(); $this->deleteUnusedSettings(); } @@ -439,12 +440,13 @@ class SettingManager implements CallbackListener, UsageInformationAble { // Trigger Settings Changed Callback if (!$init) { $this->maniaControl->getCallbackManager()->triggerCallback(self::CB_SETTING_CHANGED, $setting); - } - if ($setting->setting === self::SETTING_DISABLE_SETTING_CACHE) { - $this->disableCache = $setting->value; - if ($this->disableCache) { - $this->clearStorage(); + // during the init, value = default + if ($setting->setting === self::SETTING_DISABLE_SETTING_CACHE) { + $this->disableCache = boolval($setting->value); + if ($this->disableCache) { + $this->clearStorage(); + } } }