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

URL parameters are lost when using the Iframe widget

Details

    Description

      Context
      URL parameters are lost when multiple parameters are passed to the iframe widget, via URL parameters.

      This is due to the '&' being incorrectly escaped when crafting the URL with the passed parameters.

      Steps to Reproduce

      1. Startup Liferay
      2. Create a widget page: testwidget
        1. Navigate to testwidget page
        2. Add Announcements widget
          1. View Announcement widget > Configuration > Sharing
          2. Copy the URL in the src attribute
            1. e.g.
              http://localhost:8080/widget/web/guest/testwidget/-/com_liferay_announcements_web_portlet_AnnouncementsPortlet
            2. Note: This URL directly navigates to the created Announcements widget
        3. Navigate to the Announcements widget via the extracted URL
        4. Notice the selected tab is 'Unread'
        5. Prepare URL parameter for tabs1:
          ?_com_liferay_announcements_web_portlet_AnnouncementsPortlet_tabs1=read
        6. Append to the URL and Navigate
          • e.g.
            http://localhost:8080/widget/web/guest/testwidget/-/com_liferay_announcements_web_portlet_AnnouncementsPortlet?_com_liferay_announcements_web_portlet_AnnouncementsPortlet_tabs1=read
        7. Notice the selected tab is now 'Read'
        8. Prepare URL parameter for tabs2:
          &_com_liferay_announcements_web_portlet_AnnouncementsPortlet_tabs2=foobar
        9. Append to the URL and Navigate
          • e.g.
            http://localhost:8080/widget/web/guest/testwidget/-/com_liferay_announcements_web_portlet_AnnouncementsPortlet?_com_liferay_announcements_web_portlet_AnnouncementsPortlet_tabs1=read&_com_liferay_announcements_web_portlet_AnnouncementsPortlet_tabs2=foobar
        10. Notice the selected tab is still 'Read'
      3. Create a widget page: iframe
        1. Navigate to iframe page
        2. Add Iframe widget
          1. View Iframe widget > Configuration > Setup
            1. Set Source URL to the extracted Announcements widget URL
              1. e.g.
                http://localhost:8080/widget/web/guest/testwidget/-/com_liferay_announcements_web_portlet_AnnouncementsPortlet
            2. Click Save
          2. View Iframe widget > Configuration > Sharing
            1. Copy the URL in the src attribute
              1. e.g.
                http://localhost:8080/widget/web/guest/iframe/-/com_liferay_iframe_web_portlet_IFramePortlet_INSTANCE_feQmegAff0kG
                1. URL:
                  http://localhost:8080/widget/web/guest/iframe/-/<portlet-id>
                2. portlet-id:
                  com_liferay_iframe_web_portlet_IFramePortlet_INSTANCE_feQmegAff0kG
              2. Note: This URL directly navigates to the created Iframe widget
        3. Navigate to the Iframe widget via the extracted URL
        4. Notice the Announcement widget is shown and the selected tab is 'Unread'
        5. Prepare URL parameter for tabs1 (Take note of the underscores):
          ?_<iframe-portlet-id>_iframe__com_liferay_announcements_web_portlet_AnnouncementsPortlet_tabs1=read
          • Note: Replace <iframe-portlet-id> with the portlet-id identified in the previous step
            • e.g.
              ?_com_liferay_iframe_web_portlet_IFramePortlet_INSTANCE_feQmegAff0kG_iframe__com_liferay_announcements_web_portlet_AnnouncementsPortlet_tabs1=read
        6. Append to the URL and Navigate
          • e.g.
            http://localhost:8080/widget/web/guest/iframe/-/com_liferay_iframe_web_portlet_IFramePortlet_INSTANCE_feQmegAff0kG?_com_liferay_iframe_web_portlet_IFramePortlet_INSTANCE_feQmegAff0kG_iframe__com_liferay_announcements_web_portlet_AnnouncementsPortlet_tabs1=read
        7. Notice the selected tab is now 'Read'
        8. Prepare URL parameter for tabs2 (Take note of the underscores):
          &_<iframe-portlet-id>_iframe__com_liferay_announcements_web_portlet_AnnouncementsPortlet_tabs2=foobar
          • Note: Replace <iframe-portlet-id> with the portlet-id identified in the previous step
            • e.g.
              &_com_liferay_iframe_web_portlet_IFramePortlet_INSTANCE_feQmegAff0kG_iframe__com_liferay_announcements_web_portlet_AnnouncementsPortlet_tabs2=foobar
        9. Append to the URL and Navigate
          • e.g.
            http://localhost:8080/widget/web/guest/iframe/-/com_liferay_iframe_web_portlet_IFramePortlet_INSTANCE_feQmegAff0kG?_com_liferay_iframe_web_portlet_IFramePortlet_INSTANCE_feQmegAff0kG_iframe__com_liferay_announcements_web_portlet_AnnouncementsPortlet_tabs1=read&_com_liferay_iframe_web_portlet_IFramePortlet_INSTANCE_feQmegAff0kG_iframe__com_liferay_announcements_web_portlet_AnnouncementsPortlet_tabs2=foobar

      Expected Results
      The 'Read' tab is selected

      Actual Results
      The 'Unread' tab is selected

      Attachments

        Issue Links

          Activity

            People

              chao.wang Chao Wang
              eric.yan Eric Yan
              Marta Elicegui Marta Elicegui
              Eric Yan Eric Yan
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                2 years, 30 weeks, 5 days ago

                Packages

                  Version Package
                  7.1.10 DXP FP21
                  7.1.X
                  7.2.10 DXP FP6
                  7.2.X
                  7.3.10 DXP GA1
                  Master