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

PortletURLImpl ignores plid and portletId when modified using setters

    Details

    • Type: Bug
    • Status: Verified
    • Resolution: Unresolved
    • Affects Version/s: 7.0.0 M3
    • Fix Version/s: None
    • Component/s: None

      Description

      Steps to reproduce:
      1, Get plid of Home page (e.g. 10186)
      2, Create page Test and get plid (e.g. 10801)
      3, Go to Control Panel -> Server Administration -> Script
      4, Execute as Groovy (replace the plid with yours):

      homePlid = 10186;
      testPlid = 10801;
      
      portletURL = com.liferay.portlet.PortletURLFactoryUtil.create(actionRequest, "19", 0, "RENDER_PHASE");
      portletURL.setParameter("tag", "myTag");
      out.println(portletURL.toString());
      
      portletURL = com.liferay.portlet.PortletURLFactoryUtil.create(actionRequest, "1", 0, "RENDER_PHASE");
      portletURL.setParameter("tag", "myTag");
      portletURL.setPortletId("19");
      out.println(portletURL.toString());
      
      out.println("-----")
      
      portletURL = com.liferay.portlet.PortletURLFactoryUtil.create(actionRequest, "19", homePlid, "RENDER_PHASE");
      out.println(portletURL.toString());
      
      portletURL.setPlid(testPlid);
      out.println(portletURL.toString());
      

      Expected result:

      • First 2 URLs are the same,
      • Second 2 URLs have different page name

      Example of an actual result:

      http://localhost:8080/c/portal/layout?p_l_id=0&p_p_auth=NuQk2Kn6&p_p_id=19&p_p_lifecycle=0&refererPlid=10186&p_r_p_564233524_tag=myTag
      http://localhost:8080/c/portal/layout?p_l_id=0&p_p_id=19&p_p_lifecycle=0&refererPlid=10186&_19_tag=myTag
      -----
      http://localhost:8080/web/guest/home?p_p_auth=UyNO5VJO&p_p_id=19&p_p_lifecycle=0&refererPlid=10186
      http://localhost:8080/web/guest/home?p_p_auth=ga2vxTtB&p_p_id=19&p_p_lifecycle=0&refererPlid=10186
      

        Attachments

          Activity

            People

            Assignee:
            support-lep@liferay.com SE Support
            Reporter:
            tomas.polesovsky Tomáš Polešovský
            Participants of an Issue:
            Recent user:
            Esther Sanz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Days since last comment:
              6 years, 25 weeks ago

                Packages

                Version Package