Skip to content

Commit

Permalink
Fix getLocaleFieldName behavior with empty formField arrayName
Browse files Browse the repository at this point in the history
  • Loading branch information
nmiyazaki-chapleau authored May 28, 2024
1 parent 1bcf104 commit 6c0ef91
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 6c0ef91

Please sign in to comment.