]> BookStack Code Mirror - bookstack/blobdiff - app/Services/SettingService.php
Fixed default empty app settings effecting blank app color
[bookstack] / app / Services / SettingService.php
index bf5fa918e2b54cf7aadda0f6ff18c0875311d058..1dc30f8a001e901500486add7266e0dad3ce0bdb 100644 (file)
@@ -38,6 +38,7 @@ class SettingService
      */
     public function get($key, $default = false)
     {
+        if ($default === false) $default = config('setting-defaults.' . $key, false);
         $value = $this->getValueFromStore($key, $default);
         return $this->formatValue($value, $default);
     }
@@ -69,14 +70,6 @@ class SettingService
             return $value;
         }
 
-        // Check the defaults set in the app config.
-        $configPrefix = 'setting-defaults.' . $key;
-        if (config()->has($configPrefix)) {
-            $value = config($configPrefix);
-            $this->cache->forever($cacheKey, $value);
-            return $value;
-        }
-
         return $default;
     }