Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX Issues when running with other modules installed #860

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/Extension/FluentExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -1055,6 +1055,14 @@ public function LocaleInformation($locale = null)
$localeObj = Locale::getDefault();
}

if (!$locale && !$localeObj) {
GuySartorelli marked this conversation as resolved.
Show resolved Hide resolved
// There is no default locale, this can happen when if fluent is installed though locales have been setup
GuySartorelli marked this conversation as resolved.
Show resolved Hide resolved
// This will happen when doing integration unit testing, though can also happen during
// regular website operation
// This temporary Locale is created to prevent a invalid argument exception in RecordLocale::__construct()
$localeObj = Locale::create(['Title' => 'Temp locale']);
GuySartorelli marked this conversation as resolved.
Show resolved Hide resolved
}

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

Expand Down
Loading