Skip to content

Commit 710fe57

Browse files
author
René Hrdina
committed
feat: properly support translated info collection fields
1 parent 6cd0a40 commit 710fe57

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

bundle/EzPlatform/RepositoryForms/InformationCollectionMapper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ final class InformationCollectionMapper
2626
*/
2727
public function mapToFormData(Content $content, Location $location, ContentType $contentType)
2828
{
29-
$fields = $content->getFieldsByLanguage($content->contentInfo->mainLanguageCode);
29+
$fields = $content->getFieldsByLanguage();
3030

3131
$informationCollectionFields = [];
3232

lib/Handler.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ public function getForm(Content $content, Location $location): FormInterface
4646

4747
$data = $informationCollectionMapper->mapToFormData($content, $location, $contentType);
4848

49+
$initialLanguageCode = $content->getVersionInfo()->getInitialLanguage()->languageCode;
50+
4951
return $this->formFactory->create(InformationCollectionType::class, $data, [
50-
'languageCode' => $content->contentInfo->mainLanguageCode,
52+
'languageCode' => $initialLanguageCode ?? $content->contentInfo->mainLanguageCode,
5153
'mainLanguageCode' => $content->contentInfo->mainLanguageCode,
5254
]);
5355
}

0 commit comments

Comments
 (0)