Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-29372

Unable to edit translated Content Type migrated from Legacy to v2

    Details

      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:

      1. Install eZ Platform clean
      2. Add via Admin UI another language: pol-PL
      3. 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);
        

      4. Try to edit that Content Type in Admin UI
      5. Observe that both Content Type and Field Def names are empty.
      6. Fill-in empty names.
      7. Save Content Type.
      8. 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.

        Issue Links

          Activity

          Hide
          Bertrand Dunogier added a comment -

          Andrzej Longosz we need to add more information to this while it's hot:
          1. what happens (or doesn't) when you try to edit one of those content types
          2. maybe upload a database dump with a translated content type. It would avoid having to go through legacy and upgrade the database

          Also, given that content types can be translated using the Public API (right ?), does it happen with those as well ?

          Show
          Bertrand Dunogier added a comment - Andrzej Longosz we need to add more information to this while it's hot: 1. what happens (or doesn't) when you try to edit one of those content types 2. maybe upload a database dump with a translated content type. It would avoid having to go through legacy and upgrade the database Also, given that content types can be translated using the Public API (right ?), does it happen with those as well ?
          Hide
          Andrzej Longosz added a comment -

          I thought the same thing and reproduced the issue. I also found a workaround by adding language of a Content Type to a prioritized languages list of the admin SiteAccess. I don't really think that this is desired solution though. If a language Content Type was created in is not supported by a current admin SiteAccess, it should be just ignored, w/o error.

          Updated the issue description with steps to reproduce.

          Show
          Andrzej Longosz added a comment - I thought the same thing and reproduced the issue. I also found a workaround by adding language of a Content Type to a prioritized languages list of the admin SiteAccess. I don't really think that this is desired solution though. If a language Content Type was created in is not supported by a current admin SiteAccess, it should be just ignored, w/o error. Updated the issue description with steps to reproduce.

            People

            • Assignee:
              Unassigned
              Reporter:
              Andrzej Longosz
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: