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

ResourceURLs with cacheability=FULL incorrectly contain the current render parameters, portlet mode, and window state of the portlet

    Details

      Description

      Problem Background

      NOTE: The fix for LPS-75807 must be merged prior to testing the fix for this issue.

      The Liferay Portal implementation of resourceURL.toString() generates a URL similar to the following:

      http://localhost:8080/web/guest/mypage?p_p_id=123,foo_WAR_myportlet&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&
      p_p_cacheability=cacheLevelPage&p_r_p_myPRP=abc&foo_WAR_myportlet_myPrivateRenderParam=xyz
      

      The token "p_r_p_myPRP" indicates a public render parameter, "foo_WAR_myportlet_myPrivateRenderParam", indicates a private render parameter, "p_p_mode" indicates the PortletMode, and "p_p_state" indicates the WindowState.

      The Portlet 2.0 JavaDoc for ResourceURL.FULL states:

      The URL of type FULL does not need to contain the current state of the page or the current render parameters, portlet mode, or window state of the portlet.

      .

      However, when resourceURL.setCacheability(ResourceURL.FULL) is called prior to calling resourceURL.toString(), the only difference in Liferay Portal is the addition of the "p_p_cacheability=cacheLevelFull" name+value pair. In order to conform with the Javadoc and provide URLs with the most "cacheable" (idempotent) URL, the URL should not contain any public/private render parameters and also not contain the "p_p_mode" and "p_p_state" parameters.

      Steps to Reproduce

      1. Deploy the attached com.liferay.issue.lps75848.portlet.war artifact to $LIFERAY_HOME/deploy

      2. Add the lps75848 portlet to a portal page

      3. Reload the page in the browser

      4. Follow the 11 steps in the UI of the portlet

      Expected Result

      The values of the parameters in each step are correct. Also, in steps #8 and #11, the fully cacheable ResourceURL does not contain any public/private render parameters and also not contain the "p_p_mode" and "p_p_state" parameters.

      Actual Result

      The values of the parameters in at least one of the steps are incorrect. Also, in steps #8 and #11, the fully cacheable ResourceURL contains at least one public/private render parameter and also not contains the "p_p_mode" and "p_p_state" parameters.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              brian.chan Brian Chan
              Reporter:
              neil.griffin Neil Griffin
              Participants of an Issue:
              Recent user:
              Csaba Turcsan
              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
                  7.0.0 DXP FP36
                  7.0.0 DXP SP7
                  7.0.5 CE GA6
                  7.0.X
                  7.1.0 M1
                  7.1.X
                  Master