Skip to content

Commit

Permalink
Custom fixes for missing methods
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelHoughton committed Aug 20, 2024
1 parent 1c43bd6 commit aeae2ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Extension/FluentExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Extension/FluentSiteTreeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit aeae2ce

Please sign in to comment.