diff --git a/app/Support/FireflyConfig.php b/app/Support/FireflyConfig.php index 4368df4cc4..649f49a48f 100644 --- a/app/Support/FireflyConfig.php +++ b/app/Support/FireflyConfig.php @@ -15,6 +15,7 @@ use Auth; use Cache; use FireflyIII\Models\Configuration; use FireflyIII\Models\Preference; +use Log; /** * Class FireflyConfig @@ -48,8 +49,11 @@ class FireflyConfig */ public function get($name, $default = null) { + Log::debug('Now in FFConfig::get()', ['name' => $name]); $fullName = 'ff-config-' . $name; if (Cache::has($fullName)) { + Log::debug('Return cache.'); + return Cache::get($fullName); } @@ -57,15 +61,20 @@ class FireflyConfig if ($config) { Cache::forever($fullName, $config); + Log::debug('Return found one.'); return $config; } // no preference found and default is null: if (is_null($default)) { // return NULL + Log::debug('Return null.'); + return null; } + Log::debug('Return this->set().'); + return $this->set($name, $default); } @@ -78,7 +87,10 @@ class FireflyConfig */ public function set($name, $value): Configuration { - $item = $this->get($name, $value); + // + + $item = new Configuration; + $item->name = $name; $item->data = $value; $item->save();