Skip to content

Commit

Permalink
auto-add jsonable fields used by repeater/nested to translatable array
Browse files Browse the repository at this point in the history
  • Loading branch information
mjauvin committed Mar 27, 2024
1 parent 0720e1d commit 6ee2a55
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions classes/EventRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,15 @@ protected function getWidgetLongName($widget)
*/
protected function processFormMLFields($fields, $model, $parent = null)
{
if ($parent) {
$nameArray = HtmlHelper::nameToArray($parent);
$topArrayName = array_shift($nameArray);
if ($topArrayName && $model->isJsonable($topArrayName)) {
// make jsonable field translatable so its value can be localized
$model->addTranslatableAttributes($topArrayName);
}
}

$typesMap = [
'markdown' => 'mlmarkdowneditor',
'mediafinder' => 'mlmediafinder',
Expand Down

0 comments on commit 6ee2a55

Please sign in to comment.