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

Submitting an empty Friendly URL while having a non-empty localized Friendly URL causes errors in Edit Page menu - String index exceptions

    Details

      Description

      When user edits a page and gives a localized Friendly URL while leaving the default language Friendly URL blank, returning the the Edit Page throws exceptions and gives a blank menu.

      Here are the steps to reproduce:
      1. Navigate to localhost:8080
      2. Click Edit Page Icon
      3. Delete prefilled trailing Friendly URL (ie: /home)
      4. Create localized friendly URL (ie: /web/guest/german)
      5. Click on default flag (US Flag)
      6. Delete prefilled trailing Friendly URL (ie: /german)
      7. Assert localized friendly URL still exists
      8. Save
      9. Click Edit Page Icon
      10. Assert Blank Menu with non working tab buttons
      11. Assert exceptions

      21:24:47,931 ERROR [http-bio-8080-exec-4][IncludeTag:92] Current URL /web/guest/test?p_p_id=145&p_p_lifecycle=0&p_p_state=exclusive&p_p_mode=view&_145_groupId=10184&_145_selPlid=10458&_145_struts_action=%2Fdockbar%2Fedit_layout_panel&_145_closeRedirect=http%3A%2F%2Flocalhost%3A8080%2Fweb%2Fguest%2Ftest generates exception: String index out of range: -1
      java.lang.StringIndexOutOfBoundsException: String index out of range: -1
              at java.lang.String.substring(String.java:1875)
              at org.apache.jsp.html.portlet.layouts_005fadmin.edit_005flayout_jsp._jspService(edit_005flayout_jsp.java:1664)
              at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
              at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:57)
              at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
              at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
              at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:295)
              at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:192)
              at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:83)
              at org.apache.jsp.html.portlet.dockbar.edit_005flayout_005fpanel_jsp._jspService(edit_005flayout_005fpanel_jsp.java:1175)
              at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
              at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:57)
              at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
              at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
              at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:295)
              at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:192)
              at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:83)
              at org.apache.jsp.html.common.themes.portlet_jsp._jspService(portlet_jsp.java:2169)
      

      Expected Result:
      No errors

      Actual Result:
      Exceptions thrown and Edit Page becomes blank

      Navigating to Localized Friendly URL still works afterward.


      [reporter description]

      After a migration of a Liferay 6.1GA3 based server to 6.2RC2 with default language German, language specific friendlyURL entries in the database were converted to US english only versions. But because the default language after the migration was still German, any changes to a page of our default site resulted in an uncompleted save operation while saving the changes of the page to the database.
      The save operation crashes because it cannot find a friendly-URL for the German language. This results as a side effect in an emptry "friendlyURL" field in the layout (i.e. page) table in the database. And then everytime you try to open the change dialogue of that page, you get a truncated dialogue because the rendering routine crashes as it can't handle empty friendlyURL field values in the associated layout table entries. Afterwards user cannot change any attribute of the corresponding page. And this bug will cascade to all pages which user try to change.

      We fixed this manually in our server by changing the language setting of the friendlyURL-entries in the language specific table to German language and filling in the right friendlyURL of corrupted entries in the layout table.

        Attachments

        1. fixed.jpg
          fixed.jpg
          110 kB
        2. liferay-test-1.jpg
          liferay-test-1.jpg
          52 kB
        3. liferay-test-2.jpg
          liferay-test-2.jpg
          113 kB
        4. liferay-test-3.jpg
          liferay-test-3.jpg
          85 kB

          Issue Links

            Activity

              People

              Assignee:
              shitian.zhang Shitian "Shelton" Zhang (Inactive)
              Reporter:
              clemens.duepmeier Clemens Düpmeier
              Participants of an Issue:
              Recent user:
              Marta Elicegui
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                6 years, 38 weeks, 1 day ago

                  Packages

                  Version Package
                  6.2.2 CE GA3
                  6.2.X EE
                  7.0.0 M1