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

Cacheable content gets incorrect portlet namespace when two identical Web Contents inserted on page

    Details

    • Fix Priority:
      4

      Description

      Steps to reproduce

      1. Create structure with text field
      2. Create template for created structure in previous step
      3. Set "id" attribute for HTML element (for example <p> element) with <@portlet.namespace /> (template-content.png screenshot)
      4. Check "Cacheable" checkbox in template (template-content.png screenshot)
      5. Create Web Content
      6. On page insert at lease two Web Content Display widgets and set the same Web Content for both
      7. Open browser Developer Tools and compare <p> elements' ids with used <@portlet.namespace /> - they are the same for two web contents, but should be different. <@portlet.namespace /> should return portlet id same as it is in "portlet" CSS class

      Actual result
      Second (and others) Web Content with enabled option "Cacheable" gets portlet namespace from the first Web Content when calling <@portlet.namespace /> in FreeMarker template (cacheable-on.png screenshot). It leads to generating errors in browser that duplicated ID exists. Because of this it's impossible to pass WCAG criteria (with aria-attributes) when identificators are not unique. Issue doesn't occur when "Cacheable" option is disabled - multiple same portlets has correct portlet namespace.

      Expected result
      When template has enabled option "Cacheable" multiple inserted same contents on page will have correct own portlet namespace (cacheable-off.png).

        Attachments

        1. ActualREsult_Jun3_LPS-128147.png
          ActualREsult_Jun3_LPS-128147.png
          393 kB
        2. cacheable-off.png
          cacheable-off.png
          203 kB
        3. cacheable-on.png
          cacheable-on.png
          215 kB
        4. template-content.png
          template-content.png
          94 kB

          Activity

            People

            Assignee:
            support-lep@liferay.com SE Support
            Reporter:
            marcin.p90 Marcin Pawluk
            Participants of an Issue:
            Recent user:
            Marcin Pawluk
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Days since last comment:
              45 weeks, 1 day ago

                Packages

                Version Package