From 713786bdb89b973926c273c7a2e68bb346d02c7e Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Tue, 11 Jun 2024 09:41:45 +1200 Subject: [PATCH] FIX Preview link when no locale set --- src/Extension/FluentExtension.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Extension/FluentExtension.php b/src/Extension/FluentExtension.php index 6980ee57..3edd2ced 100644 --- a/src/Extension/FluentExtension.php +++ b/src/Extension/FluentExtension.php @@ -1160,8 +1160,11 @@ public function updateFluentCMSField(FormField $field) public function updatePreviewLink(&$link): void { $owner = $this->owner; - $info = $owner->LocaleInformation(FluentState::singleton()->getLocale()); - + $locale = FluentState::singleton()->getLocale(); + if ($locale === null || $locale === '') { + return; + } + $info = $owner->LocaleInformation($locale); if (!$info->getSourceLocale()) { $link = null; }