Skip to content

Commit

Permalink
Fix getLocaleFieldName behavior with empty formField arrayName (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
nmiyazaki-chapleau committed May 29, 2024
1 parent 1bcf104 commit 1f67fcf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions traits/MLControl.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,14 @@ protected function makeRenderFormField()

public function getLocaleFieldName($code)
{
if ($this->isLongFormNeeded()) {
$suffix = '';

if ($this->isLongFormNeeded() && !empty($this->formField->arrayName)) {
$names = HtmlHelper::nameToArray($this->formField->arrayName);
$name = $this->formField->getName('RLTranslate[' . $code . '][' . implode('][', $names) . ']');
} else {
$name = $this->formField->getName('RLTranslate['.$code.']');
$suffix = '[' . implode('][', $names) . ']';
}

return $name;
return $this->formField->getName('RLTranslate['.$code.']' . $suffix);
}

/**
Expand Down

0 comments on commit 1f67fcf

Please sign in to comment.