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

Excluding some core portlet causes redirect loop

    Details

      Description

      Step to reproduce:

      • Create a EXT Plugin
      • in the liferay-portlet-ext, add the following betweeing portlet-app tag to exclude the blog portlet:
        <portlet>
        <portlet-name>33</portlet-name>
        <include>false</include>
        </portlet>
      • Deploy the EXT plugin and restart your container

      Now browse to the portal home page will result in redirect loop.

      I debug through the liferay source code and found that the FriendlyUrlServlet#service invokes the #getRedirect method and result in NPE.
      The NPE is thrown from PortletImpl#getFriendlyURLMapperInstance because the portlet is no longer in the PortletBagPool but the PortletLocalServiceImpl#_friendlyURLMapperPortlets map still has a reference to the portlet instance.

      The fix is probably to properly remove the portlet from the _friendlyURLMapperPortlets map when the core portlet is excluded in the PortletLocalServiceImpl#initEAR.

      For those that needs to workaround this, simply set the <friendly-url-mapper-class></friendly-url-mapper-class> to null in the liferay-portlet-ext for the portlet to be excluded.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  9 years, 3 weeks, 3 days ago

                  Packages

                  Version Package
                  6.0.X EE
                  6.1.0 CE RC1