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

Unable to view Contents on frontend of new Content Types created via REST

    Details

      Description

      I tried creating several content types via REST, using session-based authentication, on REST Client.
      For one in specific (the simplest I could think of), I used the following REST parameters:

      Method:
      POST
       
      URL:
      http://ezp5.dev.vagrant/api/ezp/v2/content/typegroups/3/types?publish=true
       
      Headers:
      Accept:
      application/vnd.ez.api.ContentType
       
      Content-Type:
      application/vnd.ez.api.ContentTypeCreate
      

      Body:
      <?xml version="1.0" encoding="UTF-8"?>
      <ContentTypeCreate>
          <identifier>rest_dummy</identifier>
          <names>
              <value languageCode="eng-GB">Rest Dummy</value>
          </names>
          <descriptions>
              <value languageCode="eng-GB">dummy rest-created content type</value>
          </descriptions>
          <remoteId>remoteId-qwert550</remoteId>
          <urlAliasSchema>&lt;name&gt;</urlAliasSchema>
          <nameSchema>&lt;title&gt;</nameSchema>
          <isContainer>false</isContainer>
          <mainLanguageCode>eng-GB</mainLanguageCode>
          <defaultAlwaysAvailable>true</defaultAlwaysAvailable>
          <defaultSortField>PATH</defaultSortField>
          <defaultSortOrder>ASC</defaultSortOrder>
          <FieldDefinitions>
              <FieldDefinition>
                  <identifier>name</identifier>
                  <fieldType>ezstring</fieldType>
                  <fieldGroup>content</fieldGroup>
                  <position>10</position>
                  <isTranslatable>true</isTranslatable>
                  <isRequired>false</isRequired>
                  <isInfoCollector>false</isInfoCollector>
                  <defaultValue></defaultValue>
                  <isSearchable>true</isSearchable>
                  <names>
                      <value languageCode="eng-GB">Name</value>
                  </names>
                  <descriptions>
                      <value languageCode="eng-GB">This is the title</value>
                  </descriptions>
              </FieldDefinition>
          </FieldDefinitions>
      </ContentTypeCreate>
      

      I noticed then that the content type was successfully created (in this case, inside default 'Media' Content Type Group).
      However I found out that even though I can create contents of this new Content Type, I cannot see them on frontend.
      Since now Legacy is gone on master, the only method we can create new Content Types is via REST or the Public API, AFAIK.

        Activity

        Rui Silva (Inactive) created issue -
        Rui Silva (Inactive) made changes -
        Field Original Value New Value
        Status Open [ 1 ] Confirmed [ 10037 ]
        Rui Silva (Inactive) made changes -
        Summary Unable to create Content Types via REST Unable to view Contents on frontend of new Content Types created via REST
        Rui Silva (Inactive) made changes -
        Description I tried creating several content types via REST, using session-based authentication, on REST Client.
        For one in specific (the simplest I could think of), I used the following REST parameters:

        {noformat}
        Method:
        POST

        URL:
        http://ezp5.dev.vagrant/api/ezp/v2/content/typegroups/3/types?publish=true

        Headers:
        Accept:
        application/vnd.ez.api.ContentType

        Content-Type:
        application/vnd.ez.api.ContentTypeCreate
        {noformat}

        {noformat}
        Body:
        <?xml version="1.0" encoding="UTF-8"?>
        <ContentTypeCreate>
            <identifier>rest_dummy</identifier>
            <names>
                <value languageCode="eng-GB">Rest Dummy</value>
            </names>
            <descriptions>
                <value languageCode="eng-GB">dummy rest-created content type</value>
            </descriptions>
            <remoteId>remoteId-qwert550</remoteId>
            <urlAliasSchema>&lt;name&gt;</urlAliasSchema>
            <nameSchema>&lt;title&gt;</nameSchema>
            <isContainer>false</isContainer>
            <mainLanguageCode>eng-GB</mainLanguageCode>
            <defaultAlwaysAvailable>true</defaultAlwaysAvailable>
            <defaultSortField>PATH</defaultSortField>
            <defaultSortOrder>ASC</defaultSortOrder>
            <FieldDefinitions>
                <FieldDefinition>
                    <identifier>name</identifier>
                    <fieldType>ezstring</fieldType>
                    <fieldGroup>content</fieldGroup>
                    <position>10</position>
                    <isTranslatable>true</isTranslatable>
                    <isRequired>false</isRequired>
                    <isInfoCollector>false</isInfoCollector>
                    <defaultValue></defaultValue>
                    <isSearchable>true</isSearchable>
                    <names>
                        <value languageCode="eng-GB">Name</value>
                    </names>
                    <descriptions>
                        <value languageCode="eng-GB">This is the title</value>
                    </descriptions>
                </FieldDefinition>
            </FieldDefinitions>
        </ContentTypeCreate>
        {noformat}

        I noticed then that the content type was successfully created (in this case, inside default 'Media' Content Type Group).
        However I found out that even though I can create contents of this new Content Type, I cannot see them on frontend.
        Since now Legacy is gone on master, the only method we can create new Content Types is via REST or the Public API.
        I tried creating several content types via REST, using session-based authentication, on REST Client.
        For one in specific (the simplest I could think of), I used the following REST parameters:

        {noformat}
        Method:
        POST

        URL:
        http://ezp5.dev.vagrant/api/ezp/v2/content/typegroups/3/types?publish=true

        Headers:
        Accept:
        application/vnd.ez.api.ContentType

        Content-Type:
        application/vnd.ez.api.ContentTypeCreate
        {noformat}

        {noformat}
        Body:
        <?xml version="1.0" encoding="UTF-8"?>
        <ContentTypeCreate>
            <identifier>rest_dummy</identifier>
            <names>
                <value languageCode="eng-GB">Rest Dummy</value>
            </names>
            <descriptions>
                <value languageCode="eng-GB">dummy rest-created content type</value>
            </descriptions>
            <remoteId>remoteId-qwert550</remoteId>
            <urlAliasSchema>&lt;name&gt;</urlAliasSchema>
            <nameSchema>&lt;title&gt;</nameSchema>
            <isContainer>false</isContainer>
            <mainLanguageCode>eng-GB</mainLanguageCode>
            <defaultAlwaysAvailable>true</defaultAlwaysAvailable>
            <defaultSortField>PATH</defaultSortField>
            <defaultSortOrder>ASC</defaultSortOrder>
            <FieldDefinitions>
                <FieldDefinition>
                    <identifier>name</identifier>
                    <fieldType>ezstring</fieldType>
                    <fieldGroup>content</fieldGroup>
                    <position>10</position>
                    <isTranslatable>true</isTranslatable>
                    <isRequired>false</isRequired>
                    <isInfoCollector>false</isInfoCollector>
                    <defaultValue></defaultValue>
                    <isSearchable>true</isSearchable>
                    <names>
                        <value languageCode="eng-GB">Name</value>
                    </names>
                    <descriptions>
                        <value languageCode="eng-GB">This is the title</value>
                    </descriptions>
                </FieldDefinition>
            </FieldDefinitions>
        </ContentTypeCreate>
        {noformat}

        I noticed then that the content type was successfully created (in this case, inside default 'Media' Content Type Group).
        However I found out that even though I can create contents of this new Content Type, I cannot see them on frontend.
        Since now Legacy is gone on master, the only method we can create new Content Types is via REST or the Public API, AFAIK.
        Rui Silva (Inactive) made changes -
        Status Confirmed [ 10037 ] Closed [ 6 ]
        Resolution Invalid [ 6 ]
        André Rømcke made changes -
        Workflow eZ Engineering Scrumban Workflow [ 66271 ] EZ* Development Workflow [ 85733 ]
        Alex Schuster made changes -
        Workflow EZ* Development Workflow [ 85733 ] EZEE Development Workflow [ 124622 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Rui Silva (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: