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

PortalImpl.getPlidFromPortletId returns plid of pages with embedded portlets

Details

    • 7.0.x
    • Committed
    • 3
    • Regression Bug

    Description

      Steps to reproduce:

      1. Create a Web Content structure and template to embed a portlet inside a Web Content (I used the Documents and Media portlet and inserted the following line in the template).
        <div><@liferay_portlet["runtime"] portletName="com_liferay_document_library_web_portlet_DLPortlet" instanceId="abcdefgh" /></div>
      2. Create a web content with the above created structure and template.
      3. Put a Web Content Display portlet on a new public widget page and configure it to display the web content created in the previous step.
      4. Create another public widget page.
      5. Put the same portlet that you embedded in the web content (DM portlet in this case) on the newly created page.
      6. Run the following script (use the portletId of the portlet you chose):
         import com.liferay.portal.kernel.util.PortalUtil;
         import com.liferay.portal.kernel.service.GroupLocalServiceUtil;
        
        companyId = PortalUtil.getDefaultCompanyId();
         group = GroupLocalServiceUtil.getGroup(companyId, "Guest");
         groupId = group.getGroupId();
         portletId = "com_liferay_document_library_web_portlet_DLPortlet";
        
        plid = PortalUtil.getPlidFromPortletId(groupId, portletId);
         out.println("Plid from portletId without instanceId: " + plid);
        
        portletId = "com_liferay_document_library_web_portlet_DLPortlet_INSTANCE_abcdefgh";
        
        plid = PortalUtil.getPlidFromPortletId(groupId, portletId);
         out.println("Plid from portletId with instanceId: " + plid);

      Expected results:

      • Plid from portletId without instanceId: second page's plid
      • Plid from portletId with instanceId: 0

      Actual results:

      • Plid from portletId without instanceId: first page's plid
      • Plid from portletId with instanceId: 0

      Attachments

        Activity

          People

            jayda.wu Jayda Wu
            daniel.couso Daniel Couso
            Marta Elicegui Marta Elicegui
            Daniel Couso Daniel Couso
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              9 weeks ago

              Packages

                Version Package
                7.0.X