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

aui:script tag is executed twice for product menu

    Details

      Description

      All of the code inside of aui:script tags in JSPs related to the Product Menu get executed twice. This can lead to potential issues since scripts in tags are not meant to run twice.

      Steps to Reproduce
      1. Go into the source code to https://github.com/liferay/liferay-portal/blob/master/modules/apps/product-navigation/product-navigation-product-menu-web/src/main/resources/META-INF/resources/portlet/view.jsp
      2. Add the line

      console.log("Hello World");
      

      to the first line in the aui:script tag within the JSP and deploy the module.
      3. Start Liferay and log in, then log out.
      4. Open the browser's developer tools to the console.
      5. Log back in

      Expected Results: Hello World only prints once in the console on each page load
      Actual Results: When performing a page load through SPA (so when the navigation to the page is not the initial navigation), Hello World will print out more than once, indicating the script is being run more than once.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  15 weeks ago

                  Packages

                  Version Package
                  7.0.0 DXP FP82
                  7.0.X
                  7.1.10 DXP FP12
                  7.1.X
                  Master