Skip to content

Commit

Permalink
Merge pull request #27 from alongosz/ezp-29927-ct-translated-richtext…
Browse files Browse the repository at this point in the history
…-labels

EZP-29927: Content Type translation not used on RichText fields
  • Loading branch information
Łukasz Serwatka authored Jan 25, 2019
2 parents 06e521b + 3657b19 commit 9a34876
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/lib/Form/Mapper/RichTextFormMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,13 @@ public function mapFieldValueForm(FormInterface $fieldForm, FieldData $data)
{
$fieldDefinition = $data->fieldDefinition;
$formConfig = $fieldForm->getConfig();
$names = $fieldDefinition->getNames();
$label = $fieldDefinition->getName($formConfig->getOption('mainLanguageCode')) ?: reset($names);

$fieldForm
->add(
$formConfig->getFormFactory()->createBuilder()
->create('value', RichTextFieldType::class, [
'required' => $fieldDefinition->isRequired,
'label' => $label,
'label' => $fieldDefinition->getName(),
])
->setAutoInitialize(false)
->getForm()
Expand Down

0 comments on commit 9a34876

Please sign in to comment.