Skip to content

Commit

Permalink
fix bad logic in rewriteTranslatablePageAttributes()
Browse files Browse the repository at this point in the history
  • Loading branch information
mjauvin committed Dec 8, 2024
1 parent 90f6ece commit db7f1ba
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion behaviors/TranslatablePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ public function rewriteTranslatablePageAttributes($locale = null)

if ($locale != $this->translatableDefault) {
$translated = $this->getAttributeTranslated($attr, $locale);
$localeAttr = ($translated ?: $this->translatableUseFallback) ? $localeAttr : null;
if ($translated) {
$localeAttr = $translated;
} elseif (!$this->translatableUseFallback) {
$localeAttr = null;
}
}

$this->model[$attr] = $localeAttr;
Expand Down

0 comments on commit db7f1ba

Please sign in to comment.