Affects Version/s: 7.0.X, 7.1.X, 7.2.X, Master
Component/s: WCM > Product Menu
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
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.