From b392c41ecb97b1083714a67777d4e874d0b1e406 Mon Sep 17 00:00:00 2001 From: Denis Gorin Date: Mon, 20 Jun 2022 13:23:20 +0700 Subject: [PATCH] add isTranslatable condition in get method #3249 --- src/Entity/Field.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Entity/Field.php b/src/Entity/Field.php index 40b657879..a9407e7d0 100644 --- a/src/Entity/Field.php +++ b/src/Entity/Field.php @@ -184,7 +184,11 @@ public function get($key) return $this->getDefaultValue()->get($key); } - return $this->translate($this->getCurrentLocale(), $this->useDefaultLocale())->get($key); + if ($this->isTranslatable()) { + return $this->translate($this->getCurrentLocale(), $this->useDefaultLocale())->get($key); + } + + return $this->translate($this->getDefaultLocale(), false)->get($key); } /**