Details
-
Bug
-
Resolution: Fixed
-
Critical
-
None
-
2.1.0
-
None
Description
While we don't support translating Content Types in the new Admin UI yet, saving these migrated from Legacy should at least be possible.
Steps to reproduce:
- Install eZ Platform clean
- Add via Admin UI another language: pol-PL
- Create using PAPI new Content Type in a pol-PL language:
$contentTypeGroup = $contentTypeService->loadContentTypeGroupByIdentifier('Content'); $contentTypeStruct = $this->contentTypeService->newContentTypeCreateStruct('test_t'); $contentTypeStruct->mainLanguageCode = 'pol-PL'; $contentTypeStruct->names = ['pol-PL' => 'PL Test']; $fieldDefinitionCreateStruct = $contentTypeService->newFieldDefinitionCreateStruct('name', 'ezstring'); $fieldDefinitionCreateStruct->position = 1; $fieldDefinitionCreateStruct->names = ['pol-PL' => 'Name']; $contentTypeStruct->addFieldDefinition($fieldDefinitionCreateStruct); $contentTypeDraft = $contentTypeService->createContentType($contentTypeStruct, [$contentTypeGroup]); $contentTypeService->publishContentTypeDraft($contentTypeDraft);
- Try to edit that Content Type in Admin UI
- Observe that both Content Type and Field Def names are empty.
- Fill-in empty names.
- Save Content Type.
- Observe either HTTP 500 error in prod mode or "Notice: undefined index pol-PL" in dev mode.
Expected result
It should be possible to save Content Type without error.
Workaround
It's worth to notice that the error comes from the other language (pol-PL) not being present in the prioritized languages list of admin SiteAccess. Once it gets added, the issue disappears.
However I don't think that not having a language in the list should be a blocker for saving Content Type.
Attachments
Issue Links
- relates to
-
EZP-29757 As an administrator, I want to be able to translate a content type (AdminUI frontend)
- Closed