Skip to content

Commit

Permalink
Fix issue with loading translated data with arrayNames
Browse files Browse the repository at this point in the history
  • Loading branch information
nmiyazaki-chapleau committed Aug 1, 2024
1 parent 1f67fcf commit 0e12827
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions traits/MLControl.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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
*/
Expand Down

0 comments on commit 0e12827

Please sign in to comment.