From 803b1e115cd3a5da9369b626ddfaff9d2676f6ef Mon Sep 17 00:00:00 2001 From: Dominik Pfaffenbauer Date: Sun, 24 Nov 2024 12:19:51 +0100 Subject: [PATCH] [Resource] fallback locale could be null for newly created entities --- src/CoreShop/Component/Resource/Model/TranslatableTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CoreShop/Component/Resource/Model/TranslatableTrait.php b/src/CoreShop/Component/Resource/Model/TranslatableTrait.php index 4366a15ddf..a7ad51aebc 100644 --- a/src/CoreShop/Component/Resource/Model/TranslatableTrait.php +++ b/src/CoreShop/Component/Resource/Model/TranslatableTrait.php @@ -73,7 +73,7 @@ public function getTranslation(string $locale = null, bool $useFallbackTranslati return $translation; } - if ($useFallbackTranslation) { + if ($useFallbackTranslation && null !== $this->fallbackLocale) { $fallbackTranslation = $this->translations->get($this->fallbackLocale); if (null !== $fallbackTranslation) { $this->translationsCache[$this->fallbackLocale] = $fallbackTranslation;