From 0e12827f8f5d4658afafc8f3adfc01bf8a31b035 Mon Sep 17 00:00:00 2001 From: Naoki Miyazaki-Chapleau <104367522+nmiyazaki-chapleau@users.noreply.github.com> Date: Thu, 1 Aug 2024 07:43:42 -0400 Subject: [PATCH] Fix issue with loading translated data with arrayNames --- traits/MLControl.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/traits/MLControl.php b/traits/MLControl.php index 31eba3a..55cdbae 100644 --- a/traits/MLControl.php +++ b/traits/MLControl.php @@ -146,6 +146,10 @@ public function getLocaleValue($locale) { $key = $this->valueFrom ?: $this->fieldName; + if (!empty($this->formField->arrayName)) { + $key = $this->formField->arrayName.'['.$key.']'; + } + /* * Get the translated values from the model */ @@ -206,6 +210,10 @@ public function getLocaleSaveValue($value) $localeData = $this->getLocaleSaveData(); $key = $this->valueFrom ?: $this->fieldName; + if (!empty($this->formField->arrayName)) { + $key = $this->formField->arrayName.'['.$key.']'; + } + /* * Set the translated values to the model */