From 8d9e933f39ac712c0463d1e067c4f40bd3ba310c Mon Sep 17 00:00:00 2001 From: Paul Dwight Date: Wed, 13 Dec 2023 11:14:15 +0000 Subject: [PATCH] check incase the settings site_title hasn't been saved at all. Prevents a 404 page being returned in some cases --- src/Models/Metadata.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Models/Metadata.php b/src/Models/Metadata.php index 8951ae8..b9368d4 100644 --- a/src/Models/Metadata.php +++ b/src/Models/Metadata.php @@ -105,7 +105,11 @@ protected function getFallbackValue($columnName) // For title, we'll use the fallback column and append the site title too. if ($columnName == 'title') { - $siteTitle = TwillAppSettings::getTranslated('seo.metadata.site_title'); + $siteTitle = false; + try { + // Check if the default site title has been added at all in settings. + $siteTitle = TwillAppSettings::getTranslated('seo.metadata.site_title'); + } catch(\Exception $e) {} return strip_tags($this->meta_describable->$fallbackColumnName).($siteTitle ? ' - '.$siteTitle : ''); }