From 716dcb6de97c6dd5a3eda68aead2c664892efea4 Mon Sep 17 00:00:00 2001 From: Naoki Miyazaki-Chapleau <104367522+nmiyazaki-chapleau@users.noreply.github.com> Date: Mon, 3 Jun 2024 15:25:07 -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 */