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

Portlet preferences are reset when embedding that portlet in a theme

    Details

    • Fix Priority:
      3

      Description

      Embedding an Asset Publisher by its instance ID through the theme will cause the actual Asset Publisher placed on the page manually (and not by embedding it) to have its preferences reset to default.

      Reproduction Steps:
      1) Patch a 7.1 DXP with the latest fix pack, ensure to connect it to a productive DB like MySQL, start the server
      2) Login as an Admin, add an Asset Publisher on the Welcome page
      3) Click on the top-right ellipsis icon of that AP > Configuration > Source > Asset Type > Web Content Article. Save and close.
      4) Get the Instance ID of the portlet: top-right ellipsis icon of that AP > Look and Feel Configuration > Advanced Styling: the Instance ID is the last portion of alphanumeric chars in the "Portlet ID" field, for example: BroTzv1khFZk

      5) Create a dummy theme by adding this snippet:

      		<h2>Embedding AP ...</h2>
      
      		<@liferay_portlet["runtime"]
      			instanceId="BroTzv1khFZk"
      			portletName="com_liferay_asset_publisher_web_portlet_AssetPublisherPortlet"
      		/>
      

      in the src/templates/portal_normal.ftl, right before the closing </section> tag. The snippet is in line with the LDN: https://dev.liferay.com/en/develop/tutorials/-/knowledge_base/7-1/embedding-portlets-in-themes-and-layout-templates#embedding-a-portlet-by-portlet-name

      6) Deploy the theme, apply it to the Welcome page
      7) On both AP's check under Configuration > Source > Asset Type >

      Expected behavior: The selection to be "Web Content Article"
      Actual behavior: The selection is "Any"

      8) Once again set Configuration > Source > Asset Type > Web Content Article on the "original" AP placed manually on the page:

      Result: the two AP's will be in sync again, the embedded AP will mirror the change

       Reproduced on 7.1.x
       Reproduced on master

        Attachments

        1. test-theme.war
          3.77 MB
        2. test-theme.zip
          7.52 MB

          Activity

            People

            Assignee:
            roland.pakai Roland Pákai
            Reporter:
            roland.pakai Roland Pákai
            Participants of an Issue:
            Recent user:
            Michael Saechang
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              3 years, 3 weeks, 5 days ago

                Packages

                Version Package