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

Disabling staging with layout revisions from deleted user causes NoSuchUserException

    Details

      Description

      When disabling staging the log shows an exception. This happens if a layout revision is made by a deleted user.

      To reproduce
      1. Create an admin user, User2;
      2. Enable staging for a site, and enable page versioning.
      3. Login as User2, and make changes to the staging site.
      4. Logout of User2. Login as the original admin. Delete User2.
      5. Disable staging.
      6. Notice stack trace.

      Cause: In LayoutRevisionLocalService#deleteLayoutRevision we use the the userPersistence to find the user, which has been deleted.

      11:53:05,691 ERROR [ajp-bio-10009-exec-3352][render_portlet_jsp:132] null
      com.liferay.portal.NoSuchUserException: No User exists with the primary key 21022
      	at com.liferay.portal.service.persistence.UserPersistenceImpl.findByPrimaryKey(UserPersistenceImpl.java:7199)
      	at com.liferay.portal.service.persistence.UserPersistenceImpl.findByPrimaryKey(UserPersistenceImpl.java:7217)
      	at com.liferay.portal.service.impl.LayoutRevisionLocalServiceImpl.deleteLayoutRevision(LayoutRevisionLocalServiceImpl.java:170)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
      	at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
      	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.impl.LayoutRevisionLocalServiceImpl.deleteLayoutRevisions(LayoutRevisionLocalServiceImpl.java:218)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
      	at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
      	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.impl.LayoutBranchLocalServiceImpl.deleteLayoutBranch(LayoutBranchLocalServiceImpl.java:115)
      	at com.liferay.portal.service.impl.LayoutBranchLocalServiceImpl.deleteLayoutSetBranchLayoutBranches(LayoutBranchLocalServiceImpl.java:130)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
      	at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
      	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:51)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  4 years, 37 weeks, 4 days ago

                  Packages

                  Version Package
                  6.1.X EE
                  6.2.4 CE GA5
                  6.2.X EE
                  7.0.0 M5