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

Language Selector redirect is not working when language-specific Home URL is set

Details

    Description

      1. Set up and start a portal
      2. Create a new site called 'customer'
      3. Create a random page for it, to be able to access http://localhost:8080/web/customer
      4. Place a Language Selector portlet onto it
      5. Set the home URLs: Control Panel > Instance settings > Instance Configuration > General > Set Home URL + Default Logout Page + Default Landing Page to /es/web/customer
      6. Open an incognito window and go to http://localhost:8080/ (this should show the Spanish version of the site)
      7. Select another language in Language Selector (Selector de Idioma)

      Expected result: no error thrown, the portal switches to the selected language
      Actual result: Error page is shown, Exception in the logs:

      2020-02-02 18:46:02.312 WARN  [http-nio-8080-exec-8][PortalImpl:6566] javax.servlet.ServletException: java.lang.StringIndexOutOfBoundsException: String index out of range: -2
      javax.servlet.ServletException: java.lang.StringIndexOutOfBoundsException: String index out of range: -2
              at com.liferay.portal.struts.PortalRequestProcessor._process(PortalRequestProcessor.java:428)
              at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:155)
              at com.liferay.portal.internal.servlet.MainServlet.doGet(MainServlet.java:205)
      ...
              at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
              at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
              at java.lang.Thread.run(Thread.java:748)
      Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -2
              at java.lang.String.substring(String.java:1931)
              at com.liferay.portal.action.UpdateLanguageAction.execute(UpdateLanguageAction.java:121)
              at com.liferay.portal.struts.PortalRequestProcessor._process(PortalRequestProcessor.java:415)
              ... 92 more
      

      Attachments

        Issue Links

          Activity

            People

              michael.eguina Michael Eguina (Inactive)
              vendel.toreki Vendel Töreki
              Kiyoshi Lee Kiyoshi Lee
              Vendel Töreki Vendel Töreki
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                3 years ago

                Packages

                  Version Package
                  7.0.0 DXP FP92
                  7.0.10.14 DXP SP14
                  7.0.X
                  7.1.10 DXP FP18
                  7.1.10.5 SP5
                  7.1.X
                  7.2.10 DXP FP5
                  7.2.10.2 DXP SP2
                  7.2.X
                  7.3.1 CE GA2
                  7.3.2 CE GA3
                  7.3.10 DXP GA1
                  Master