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

After upgrading from 6.0 sp2 to Liferay 7 with an image in the Image Gallery, documents cannot be added

Details

    Description

      Description
      Upgrading from 6.0 sp2 to Liferay 7, we look at all the companyIds in the IG_Image table and add an IMAGE-GALLERY-IMAGE DLFileEntryType for each of those companyIds. But we don't add the ResourcePermissions for them, which causes errors when trying to visit the Documents and Media portlet, ultimately making it impossible to add a new document.

      Steps to Reproduce
      1. Start up Liferay 6.0 sp2 and log in as the admin user.
      2. Navigate to Control Panel > Liferay Site > Image Gallery.
      3. Add an image to the image gallery.
      4. Shut down Liferay.
      5. Upgrade to DXP.
      6. Navigate to Control Panel > Liferay Site > Documents and Media.

      Expected Result: The add button is there in the bottom-right corner, so that a new document, folder, or shortcut can be added.
      Actual Result: The add button is not there, and the following stack trace appears in the console:

      com.liferay.portal.kernel.exception.NoSuchResourcePermissionException: {companyId=10136, name=com.liferay.document.library.kernel.model.DLFileEntryType, primKey=10502, scope=4}
              at com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl.hasResourcePermission(ResourcePermissionLocalServiceImpl.java:710)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:163)
              at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:54)
              at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:58)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
              at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:169)
              at com.liferay.portal.service.impl.ResourceLocalServiceImpl.hasUserPermissions(ResourceLocalServiceImpl.java:450)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:163)
              at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:54)
              at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:58)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
              at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:169)
              at com.liferay.portal.kernel.service.ResourceLocalServiceUtil.hasUserPermissions(ResourceLocalServiceUtil.java:323)
              at com.liferay.portal.security.permission.AdvancedPermissionChecker.doCheckPermission(AdvancedPermissionChecker.java:598)
              at com.liferay.portal.security.permission.AdvancedPermissionChecker._hasUserPermissionImpl(AdvancedPermissionChecker.java:1596)
              at com.liferay.portal.security.permission.AdvancedPermissionChecker._hasPermissionImpl(AdvancedPermissionChecker.java:1565)
      

      Attachments

        Activity

          People

            summer.zhang Summer Zhang
            michael.bowerman Michael Bowerman
            Austin Chiang Austin Chiang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              5 years, 18 weeks, 1 day ago

              Packages

                Version Package
                7.0.0 DXP FP33
                7.0.0 DXP SP7
                7.0.5 CE GA6
                7.0.X
                7.1.X
                Master