]> BookStack Code Mirror - bookstack/commitdiff
Fixed default empty app settings effecting blank app color
authorDan Brown <redacted>
Sun, 8 Jan 2017 18:42:46 +0000 (18:42 +0000)
committerDan Brown <redacted>
Sun, 8 Jan 2017 18:42:46 +0000 (18:42 +0000)
Fixes #265

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;
     }