From aeae2ce5ea3905c1852abf1e0888d22a39be0348 Mon Sep 17 00:00:00 2001 From: Michael Houghton Date: Tue, 20 Aug 2024 08:55:04 +0100 Subject: [PATCH 1/2] Custom fixes for missing methods --- src/Extension/FluentExtension.php | 2 +- src/Extension/FluentSiteTreeExtension.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Extension/FluentExtension.php b/src/Extension/FluentExtension.php index 1a4750bf..6e353b74 100644 --- a/src/Extension/FluentExtension.php +++ b/src/Extension/FluentExtension.php @@ -1068,7 +1068,7 @@ public function getLocaleInstances(): array { $locales = []; foreach ($this->owner->Locales() as $info) { - if ($info->IsDraft()) { + if (method_exists($info, 'IsDraft') && $info->IsDraft()) { $locales[] = $info->getLocaleObject(); } } diff --git a/src/Extension/FluentSiteTreeExtension.php b/src/Extension/FluentSiteTreeExtension.php index 6d1fc5ab..d4280043 100644 --- a/src/Extension/FluentSiteTreeExtension.php +++ b/src/Extension/FluentSiteTreeExtension.php @@ -279,7 +279,7 @@ protected function getLocaleStatusMessage(): ?string $info = $owner->LocaleInformation($locale); // Our content hasn't been drafted or published. - if ($info->getSourceLocale()) { + if (method_exists($info && 'getSourceLocale') && $info->getSourceLocale()) { // If this Locale has a Fallback, then content might be getting inherited from that Fallback. return _t( __CLASS__ . '.LOCALESTATUSFLUENTINHERITED', @@ -506,7 +506,7 @@ protected function updateNoSourceFlag(array &$flags): void $owner = $this->owner; $info = $owner->LocaleInformation($locale); - if ($info->getSourceLocale()) { + if (method_exists($info, 'getSourceLocale') && $info->getSourceLocale()) { return; } From c8cdac8ceb71863180fca95da7788073d607814b Mon Sep 17 00:00:00 2001 From: Michael Houghton Date: Wed, 21 Aug 2024 08:44:33 +0100 Subject: [PATCH 2/2] Fix for method_exists parameter error --- src/Extension/FluentSiteTreeExtension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Extension/FluentSiteTreeExtension.php b/src/Extension/FluentSiteTreeExtension.php index d4280043..a6117fa6 100644 --- a/src/Extension/FluentSiteTreeExtension.php +++ b/src/Extension/FluentSiteTreeExtension.php @@ -279,7 +279,7 @@ protected function getLocaleStatusMessage(): ?string $info = $owner->LocaleInformation($locale); // Our content hasn't been drafted or published. - if (method_exists($info && 'getSourceLocale') && $info->getSourceLocale()) { + if (method_exists($info, 'getSourceLocale') && $info->getSourceLocale()) { // If this Locale has a Fallback, then content might be getting inherited from that Fallback. return _t( __CLASS__ . '.LOCALESTATUSFLUENTINHERITED',