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

IFrame source URL is truncated and replaced with a call to "/undefined"

    Details

      Description

      IFrame source URL is truncated and replaced with a call to "/undefined"

      Reproduction steps:

      1. Start an instance
      2. Create a new site called "testsite"
      3. Create a widget page called "page1"
      4. Create a widget page called "page2"
      5. Create a "link to page" type of page, called "linkpage", set the target URL to "http://localhost:8080/web/testsite/page2"
      6. Put IFrame portlet onto page1
      7. Configure the following source URL "http://localhost:8080/web/testsite/linkpage"
      8. When refreshing the site you will notice in Chrome DevTools on the Network tab that there is an undefined call
      9. Every time the last part of the URL is truncated and replaced with a call to "/undefined". The domain remains intact, but a call to "https://DOMAIN/PATH/undefined" is not the expected behaviour

      Most likely this is the cause LPS-105535

      		function init() {
      			var hash = document.location.hash.replace('#', '');
      
      			var hashObj = A.QueryString.parse(hash);
      
      			hash = String(hashObj['_com_liferay_iframe_web_portlet_IFramePortlet_INSTANCE_fU5u7OZU3wd0_']);
      
      			var iframe = A.one('#_com_liferay_iframe_web_portlet_IFramePortlet_INSTANCE_fU5u7OZU3wd0_iframe');
      
      			if (iframe) {
      				if (hash) {
      					var src = '';
      
      					var baseSrc =
      						'http\x3a\x2f\x2flocalhost\x3a8080\x2fweb\x2ftestsite\x2f';
      
      					if (
      						!/^https?\:\/\//.test(hash) ||
      						!A.Lang.String.startsWith(hash, baseSrc)
      					) {
      						src = A.QueryString.unescape(hash);
      					}
      
      					iframe.attr('src', baseSrc + src);
      				}
      
      				iframe.on('load', monitorIframe);
      			}
      		}
      

      hash is undefined

      Reproduced on
      7.2.x 549078ccddf895b09d40ac38767524b1144c8b76
      Master 88e9fafef044890033f15c89d8376cec8948ea35

        Attachments

          Activity

            People

            Assignee:
            yang.cao Yang Cao
            Reporter:
            vendel.toreki Vendel Töreki
            Participants of an Issue:
            Recent user:
            Jason Pince
            Engineering Assignee:
            Vendel Töreki
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

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

                Packages

                Version Package
                7.2.10 DXP FP8
                7.2.10.3 DXP SP3
                7.2.X
                7.3.4 CE GA5
                7.3.10 DXP GA1
                Master