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

Unwanted template script is shown on the Web Content Item selector

    Details

      Description

      Reproduction steps

      1) Create a new Web Content Structure with a Text Box field
      2) Create a new Web Content Template for the new Structure and add a following script to the template source

      <@liferay_aui.script use="aui-base">
      console.log('My template is processed!');
      </@liferay_aui.script>
      

      3) Uncheck Cacheable
      4) Create a new Web Content based on the new Structure
      5) Create a new Widget Page
      6) Add a Web Content Display
      7) On the Web Content Display - Configuration Select a Web Content

      Notice: When opening the Select Web Content modal the browser's console will print: 
      My template is processed!

      Expected: No log in the browser's console

      Analysis

      The asset-browser-web is used to list the Web Contents in the search-container.

      https://github.com/liferay/liferay-portal-ee/blob/7.3.x/modules/apps/asset/asset-browser-web/src/main/resources/META-INF/resources/view.jsp#L167-L171

      In the search-container the Description column loads the getSummary from the JournalArticleAssetRenderer where the summary is the articleDisplay.getContent().

      https://github.com/liferay/liferay-portal-ee/blob/7.3.x/modules/apps/journal/journal-web/src/main/java/com/liferay/journal/web/internal/asset/model/JournalArticleAssetRenderer.java#L231-L238

      Related PTR-2329

      Suggested solutionhttps://issues.liferay.com/browse/PTR-2329?focusedCommentId=2413704&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-2413704

        Attachments

          Activity

            People

            Assignee:
            yang.cao Yang Cao
            Reporter:
            roland.pakai Roland Pákai
            Participants of an Issue:
            Recent user:
            Rafaela Nascimento
            Engineering Assignee:
            Eudaldo Alonso
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              1 year, 5 weeks, 5 days ago

                Packages

                Version Package
                7.3.X
                7.4.0 CE GA1 DXP 7,4
                7.4.13 DXP GA1
                Master