Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Commit

Permalink
fix(Tinebase/User): use default/auto locale for twig if missing
Browse files Browse the repository at this point in the history
  • Loading branch information
pschuele committed Feb 23, 2023
1 parent 814ddd4 commit 2107670
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tine20/Tinebase/Model/User.php
Expand Up @@ -268,7 +268,11 @@ public function toArray($_recursive = TRUE)

public function applyAccountTwig($name, $twig)
{
$twig = new Tinebase_Twig(Tinebase_Core::getLocale(), Tinebase_Translation::getTranslation(), [
$locale = Tinebase_Core::getLocale();
if (! $locale) {
$locale = Tinebase_Translation::getLocale();
}
$twig = new Tinebase_Twig($locale, Tinebase_Translation::getTranslation(), [
Tinebase_Twig::TWIG_LOADER =>
new Tinebase_Twig_CallBackLoader(__METHOD__ . $name, time() - 1, function() use($twig) { return $twig; })
]);
Expand Down

0 comments on commit 2107670

Please sign in to comment.