Skip to content

Commit

Permalink
check incase the settings site_title hasn't been saved at all. Preven…
Browse files Browse the repository at this point in the history
…ts a 404 page being returned in some cases
  • Loading branch information
pauldwight committed Dec 13, 2023
1 parent 505095a commit 8d9e933
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Models/Metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 : '');
}

Expand Down

0 comments on commit 8d9e933

Please sign in to comment.