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.
        Hide
        André Rømcke added a comment - - edited

        Have you configured frontend/DemoBundle to display this new type?
        Any other things done differently here then previous REST testing?

        Show
        André Rømcke added a comment - - edited Have you configured frontend/DemoBundle to display this new type? Any other things done differently here then previous REST testing?
        Hide
        Rui Silva (Inactive) added a comment -

        André Rømcke, having registered or not registered my new content type on:
        vendor/ezsystems/demobundle/EzSystems/DemoBundle/Resources/config/default_settings.yml
        doesn't seem to change anything regarding being able to show a content of my content type.
        Whether I have that setting or not, on an old master with legacy still, I can make it show correctly on accessing it through frontend, whereas on a recent master without Legacy I always get the following error on prod.log:

        [2015-02-23 14:32:45] app.NOTICE: Siteaccess not matched against configuration, returning default siteaccess. [] []
        [2015-02-23 14:32:45] app.DEBUG: Router eZ\Bundle\EzPublishCoreBundle\Routing\DefaultRouter was not able to match, message "" [] []
        [2015-02-23 14:32:45] app.INFO: UrlAlias matched location #143. Forwarding to ViewController [] []
        [2015-02-23 14:32:45] request.INFO: Matched route "ez_urlalias" (parameters: "_route": "ez_urlalias", "_controller": "ez_content:viewLocation", "locationId": "143", "viewType": "full", "layout": "true") [] []
        [2015-02-23 14:32:45] security.DEBUG: Read SecurityContext from the session [] []
        [2015-02-23 14:32:45] security.DEBUG: Reloading user from user provider. [] []
        [2015-02-23 14:32:45] security.DEBUG: Username "admin" was reloaded from user provider. [] []
        [2015-02-23 14:32:45] request.CRITICAL: Uncaught PHP Exception RuntimeException: "Unable to find a view for location #143" at /var/www/html/ezpublish5.2/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/MVC/Symfony/View/Manager.php line 282 {"exception":"[object] (RuntimeException(code: 0): Unable to find a view for location #143 at /var/www/html/ezpublish5.2/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/MVC/Symfony/View/Manager.php:282)"} []
        [2015-02-23 14:32:45] security.DEBUG: Write SecurityContext in the session [] []
        

        and a "500 Internal Server Error" on frontend rendering.

        Show
        Rui Silva (Inactive) added a comment - André Rømcke , having registered or not registered my new content type on: vendor/ezsystems/demobundle/EzSystems/DemoBundle/Resources/config/default_settings.yml doesn't seem to change anything regarding being able to show a content of my content type. Whether I have that setting or not, on an old master with legacy still, I can make it show correctly on accessing it through frontend, whereas on a recent master without Legacy I always get the following error on prod.log: [2015-02-23 14:32:45] app.NOTICE: Siteaccess not matched against configuration, returning default siteaccess. [] [] [2015-02-23 14:32:45] app.DEBUG: Router eZ\Bundle\EzPublishCoreBundle\Routing\DefaultRouter was not able to match, message "" [] [] [2015-02-23 14:32:45] app.INFO: UrlAlias matched location #143. Forwarding to ViewController [] [] [2015-02-23 14:32:45] request.INFO: Matched route "ez_urlalias" (parameters: "_route": "ez_urlalias", "_controller": "ez_content:viewLocation", "locationId": "143", "viewType": "full", "layout": "true") [] [] [2015-02-23 14:32:45] security.DEBUG: Read SecurityContext from the session [] [] [2015-02-23 14:32:45] security.DEBUG: Reloading user from user provider. [] [] [2015-02-23 14:32:45] security.DEBUG: Username "admin" was reloaded from user provider. [] [] [2015-02-23 14:32:45] request.CRITICAL: Uncaught PHP Exception RuntimeException: "Unable to find a view for location #143" at /var/www/html/ezpublish5.2/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/MVC/Symfony/View/Manager.php line 282 {"exception":"[object] (RuntimeException(code: 0): Unable to find a view for location #143 at /var/www/html/ezpublish5.2/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/MVC/Symfony/View/Manager.php:282)"} [] [2015-02-23 14:32:45] security.DEBUG: Write SecurityContext in the session [] [] and a "500 Internal Server Error" on frontend rendering.
        Hide
        Rui Silva (Inactive) added a comment -

        Found out cause of error and corrected it. Results from a lack of Legacy fallback for template rendering (for new CT), now that Legacy is gone.
        Closing this.

        Show
        Rui Silva (Inactive) added a comment - Found out cause of error and corrected it. Results from a lack of Legacy fallback for template rendering (for new CT), now that Legacy is gone. Closing this.
        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 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Confirmed Confirmed
        14m 9s 1 rui.silva@ez.no 23/Feb/15 9:17 AM
        Confirmed Confirmed Closed Closed
        1d 6h 54m 1 rui.silva@ez.no 24/Feb/15 4:12 PM

          People

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

            Dates

            • Created:
              Updated:
              Resolved: