Skip to content

Commit

Permalink
FIX Create a temp locale if there is not a default
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Jun 6, 2024
1 parent eaece0a commit 8d0057a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Extension/FluentExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -1055,6 +1055,12 @@ public function LocaleInformation($locale = null)
$localeObj = Locale::getDefault();
}

if (!$locale && !$localeObj) {
// There is no default locale, this can happen when unit testing unrelated modules while fluent is installed
// This is done to purely to prevent a invalid argument exception in RecordLocale::__construct()
$localeObj = Locale::create(['Title' => 'Temp locale']);
}

return RecordLocale::create($this->owner, $localeObj);
}

Expand Down

0 comments on commit 8d0057a

Please sign in to comment.