Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-141140

Site initializer fails to process fragments in pages when virtual instance is created with Portal Instance API

    Description

    Steps to reproduce:

    1. Make sure the site-initializer/site-initializer-masterclass is deployed.
    2. Go to Virtual Instances > Add Virtual Instance
    3. Fill in all the fields
    4. Select Masterclass in the drop down to initialize the instance
    5. Wait until the instance is initialized
    6. Assert that no errors are shown in the logs
    7. Now create a new virtual instance with the same initializer, using the portal instances API:
    curl -X 'POST' 'http://localhost:8080/o/headless-portal-instances/v1.0/portal-instances' -d $'{"domain": "insurance.com", "portalInstanceId": "masterclass", "siteInitializerKey": "com.liferay.site.initializer.masterclass", "virtualHost": "www.bootcamp.com"}' --header 'Content-Type: application/json' -u '[email protected]:test'
    

    Expected behavior: Logs show no errors

    Current behavior: Console show errors

    Technical Details:

    • When the fragments of the master pages are processed by the PortletFragmentEntryProcessor, the HTML of the widgets is obtain with portletFragmentRenderer.renderPortlet. This method obtains the httpServletResponse from the fragmentEntryProcessorContext.
    • When creating a virtual instance in the UI, the response exists
    • When creating a virtual instance with the headless API, the response is null. As a result, the master page is not processed, and the virtual instance default site (initialized with the site initializer) fails to render correctly.

      Attachments

        Issue Links

          Activity

            People

            Assignee:
            team-echo Product Team Echo
            Reporter:
            eduardo.garcia Eduardo García (Inactive)
            Participants of an Issue:
            Recent user:
            Lu Liu
            Engineering Assignee:
            Lourdes Fernandez Besada
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              16 weeks, 2 days ago

                Packages

                Version Package
                7.4.3.17 CE GA17
                Master