Fix each bar provider not set breaking page

This commit is contained in:
KodeStar
2018-02-05 17:06:52 +00:00
parent db70a6af33
commit 7867c7b3ca
2 changed files with 11 additions and 2 deletions

View File

@@ -168,6 +168,15 @@ class Setting extends Model
$output = '';
$homepage_search = self::fetch('homepage_search');
$search_provider = self::where('key', '=', 'search_provider')->first();
//die(var_dump($search_provider->value));
// return early if search isn't applicable
if((bool)$homepage_search !== true) return $output;
if($search_provider->value === 'none') return $output;
if(empty($search_provider->value)) return $output;
if(is_null($search_provider->value)) return $output;
if((bool)$homepage_search && (bool)$search_provider) {
$options = (array)json_decode($search_provider->options);