|
@@ -88,7 +88,7 @@ discard block |
|
|
block discarded – undo |
|
88
|
88
|
} |
|
89
|
89
|
|
|
90
|
90
|
// 'populate' fields by *hook on form generation |
|
91
|
|
- $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) use ($fieldName, $translations, $fieldType, $class, $required, $className, $id) { |
|
|
91
|
+ $builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) use ($fieldName, $translations, $fieldType, $class, $required, $className, $id) { |
|
92
|
92
|
$form = $event->getForm(); |
|
93
|
93
|
foreach ($this->locales as $locale) { |
|
94
|
94
|
$data = (array_key_exists($locale, $translations) && array_key_exists($fieldName, $translations[$locale])) ? $translations[$locale][$fieldName] : null; |
|
@@ -109,7 +109,7 @@ discard block |
|
|
block discarded – undo |
|
109
|
109
|
$form->add('currentFieldName', 'hidden', ['data' => $fieldName]); |
|
110
|
110
|
}); |
|
111
|
111
|
|
|
112
|
|
- $builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) use ($fieldName, $className, $id) { |
|
|
112
|
+ $builder->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) use ($fieldName, $className, $id) { |
|
113
|
113
|
$form = $event->getForm(); |
|
114
|
114
|
$this->manager->persistTranslations($form, $className, $fieldName, $id, $this->locales); |
|
115
|
115
|
}); |