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

Deleting a page throws an Exception during going back in the browser history

    Details

    • What problem did the customer find?:
      Hide
      After a Public Page deletion, when you go back in the browser history, the portal returns with NullPointerException.

      Reproduction steps:

      1. Click on the "Menu button" (Sidebar will be opened on the left side).
      2. Activate the menu of "Public Pages" section and click on the "Add Public Page".
      3. Fill the name section and click on the "Add Page" button.
      4. Activate the new page's menu and click on the "Configure Page".
      5. Activate the "Options" menu on the top of the right side and click on the "Delete"
      6. Confirm this deletion.
      7. Click on the Browser's Back button
      Show
      After a Public Page deletion, when you go back in the browser history, the portal returns with NullPointerException. Reproduction steps: 1. Click on the "Menu button" (Sidebar will be opened on the left side). 2. Activate the menu of "Public Pages" section and click on the "Add Public Page". 3. Fill the name section and click on the "Add Page" button. 4. Activate the new page's menu and click on the "Configure Page". 5. Activate the "Options" menu on the top of the right side and click on the "Delete" 6. Confirm this deletion. 7. Click on the Browser's Back button
    • What do you think is the root cause? (if known):
      Hide
      The repeated POST request is not handled well in the browser. An exception should be caught during the action or the render phase.
      For more information, pls find my comments on the LPS.
      Show
      The repeated POST request is not handled well in the browser. An exception should be caught during the action or the render phase. For more information, pls find my comments on the LPS.
    • Proposed solution (if any):
      An exception should be thrown instead of the current behavior, with a "Not found" error on the page.

      Description

      Steps to reproduce @ master & 7.0.x

      1. Start Master bundle.
      2. Click on the "Menu button" (Sidebar will be opened on the left side).
      3. Activate the menu of "Public Pages" section and click on the "Add Public Page".
      4. Fill the name section and click on the "Add Page" button.
      5. Activate the new page's menu and click on the "Configure Page".
      6. Activate the "Options" menu on the top of the right side and click on the "Delete"
      7. Confirm this deletion.
      8. Click on the Browser's Back button

      Actual result

      17:31:31,408 ERROR [http-nio-8080-exec-8][IncludeTag:128] Current URL /liferay-portal/group/guest/~/control_panel/manage?p_p_id=com_liferay_layout_admin_web_portlet_GroupPagesPortlet&p_p_lifecycle=0&p_p_state=maximized&p_r_p___selPlid=34623&_com_liferay_layout_admin_web_portlet_GroupPagesPortlet_groupId=20140&p_p_auth=KqSYbtUt generates exception: java.lang.NullPointerException
      java.lang.NullPointerException
      at org.apache.jsp.edit_005flayout_jsp._jspService(edit_005flayout_jsp:414)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
      at com.liferay.portal.osgi.web.servlet.jsp.compiler.JspServlet.service(JspServlet.java:413)
      at com.liferay.portal.osgi.web.servlet.jsp.compiler.JspServlet.service(JspServlet.java:424)
      at org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153)
      at org.eclipse.equinox.http.servlet.internal.servlet.ResponseStateHandler.processRequest(ResponseStateHandler.java:62)
      at org.eclipse.equinox.http.servlet.internal.context.DispatchTargets.doDispatch(DispatchTargets.java:117)
      at org.eclipse.equinox.http.servlet.internal.servlet.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:48)
      at com.liferay.portal.servlet.DirectServletPathRegisterDispatcher.include(DirectServletPathRegisterDispatcher.java:67)
      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.includePage(IncludeTag.java:372)
      at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:349)
      at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:202)
      at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:86)
      

      Steps to reproduce @ 6.2.x

      1. Start portal
      2. Go to Admin/Pages
      3. Create a page
      4. Select the page and delete it
      5. Click on the Browser's Back button

      Actual result

      11:24:06,042 ERROR [http-bio-8080-exec-9][render_portlet_jsp:132] null
       com.liferay.portal.NoSuchLayoutException: No Layout exists with the primary key 20503
       at com.liferay.portal.service.persistence.LayoutPersistenceImpl.findByPrimaryKey(LayoutPersistenceImpl.java:10568)
       at com.liferay.portal.service.persistence.LayoutPersistenceImpl.findByPrimaryKey(LayoutPersistenceImpl.java:10586)
       at com.liferay.portal.service.base.LayoutLocalServiceBaseImpl.getLayout(LayoutLocalServiceBaseImpl.java:339)
       at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
       at com.liferay.portal.service.impl.LayoutLocalServiceVirtualLayoutsAdvice.invoke(LayoutLocalServiceVirtualLayoutsAdvice.java:81)
       at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
       at com.liferay.portal.service.impl.LayoutLocalServiceStagingAdvice.invoke(LayoutLocalServiceStagingAdvice.java:141)
       at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
       at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:65)
       at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:51)
       at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
       at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:175)
       at com.liferay.portal.service.LayoutLocalServiceUtil.getLayout(LayoutLocalServiceUtil.java:230)
       at com.liferay.portlet.layoutsadmin.action.EditLayoutsAction.checkPermissions(EditLayoutsAction.java:408)
       at com.liferay.portlet.layoutsadmin.action.EditLayoutsAction.render(EditLayoutsAction.java:313)
       at com.liferay.portal.struts.PortletAction.execute(PortletAction.java:119)
       at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
       at com.liferay.portal.struts.PortletRequestProcessor.processActionPerform(PortletRequestProcessor.java:454)
       at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
       at com.liferay.portal.struts.PortletRequestProcessor.process(PortletRequestProcessor.java:234)
      

      Expected behavior

      Catching the exception and redirection to the Site Pages with a 'Not found' error message.

       

      Additional information

      In master and 7.0.x, the doDispatch method of LayoutAdminPortlet, while in 6.2.x the EditLayoutsAction needs to be modified. Therefore the original solution and the backport will differ from each other.

        Attachments

        1. current_behavior_1.PNG
          current_behavior_1.PNG
          41 kB
        2. current_behavior_2.PNG
          current_behavior_2.PNG
          42 kB
        3. current_behavior_3.PNG
          current_behavior_3.PNG
          21 kB
        4. fix.PNG
          fix.PNG
          22 kB
        5. master.PNG
          master.PNG
          68 kB

          Issue Links

            Activity

              People

              Assignee:
              support-lep@liferay.com SE Support
              Reporter:
              szilvia.kadar Szilvia Kadar (Inactive)
              Participants of an Issue:
              Recent user:
              Marta Elicegui
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

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

                  Packages

                  Version Package
                  Master