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

No repository associated with file entry

Details

    Description

      This ticket is to report a bug in the com.liferay.document.library.web.internal.display.context.DLAdminDisplayContext class.

      The error can be found on line 693 within the _getDLSearchContainer() method. I believe this line should be using the assetEntry.getClassPK() as the fileEntryId rather than the assetEntry.getClassNameId(), which will always be 20011. I believe the correct code is as follows:

      685:   for (AssetEntry assetEntry :
      686:         AssetEntryServiceUtil.getEntries(assetEntryQuery)) {
      687:
      688:      if (Objects.equals(
      689:            assetEntry.getClassName(),
      690:            DLFileEntryConstants.getClassName())) {
      691:
      692:         results.add(
      693:            DLAppLocalServiceUtil.getFileEntry(									694:               assetEntry.getClassPK()));
      695:      }
      696:      else {
      697:         results.add(
      698:            DLAppLocalServiceUtil.getFileShortcut(									699:               assetEntry.getClassPK()));
      700:      }
      701:   }
      

      The issue is visible in the Documents and Manuals section of the Liferaybotics demo but should be replicable in other forms. The error is revealed when using a Category Filter configured for Category Navigation is used to filter the Documents and Media widget.

      The following stack trace is visible in the logs

      2022-03-03 08:28:22.236 ERROR [http-nio-8080-exec-8][render_portlet_jsp:131] null
      com.liferay.portal.kernel.repository.InvalidRepositoryIdException: No repository associated with file entry 20011
      	at com.liferay.portal.repository.RepositoryProviderImpl.getFileEntryRepositoryId(RepositoryProviderImpl.java:436) ~[portal-impl.jar:?]
      	at com.liferay.portal.repository.RepositoryProviderImpl.getFileEntryLocalRepository(RepositoryProviderImpl.java:90) ~[portal-impl.jar:?]
      	at com.liferay.portlet.documentlibrary.service.impl.DLAppLocalServiceImpl.getFileEntry(DLAppLocalServiceImpl.java:707) ~[portal-impl.jar:?]
      	at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:66) ~[portal-kernel.jar:?]
      	at com.liferay.document.library.kernel.service.DLAppLocalServiceWrapper.getFileEntry(DLAppLocalServiceWrapper.java:558) ~[portal-kernel.jar:?]
      	at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:66) ~[portal-kernel.jar:?]
      	at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:50) ~[portal-impl.jar:?]
      	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:69) ~[portal-impl.jar:?]
      	at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:57) ~[portal-impl.jar:?]
      	at com.liferay.portal.spring.aop.AopInvocationHandler.invoke(AopInvocationHandler.java:49) ~[portal-impl.jar:?]
      	at com.liferay.document.library.kernel.service.DLAppLocalServiceUtil.getFileEntry(DLAppLocalServiceUtil.java:549) ~[portal-kernel.jar:?]
      	at com.liferay.document.library.web.internal.display.context.DLAdminDisplayContext._getDLSearchContainer(DLAdminDisplayContext.java:693) ~[?:?]
      	at com.liferay.document.library.web.internal.display.context.DLAdminDisplayContext.getSearchContainer(DLAdminDisplayContext.java:293) ~[?:?]
      	at com.liferay.document.library.web.internal.display.context.DLAdminManagementToolbarDisplayContext.<init>(DLAdminManagementToolbarDisplayContext.java:94) ~[?:?]
      	at com.liferay.document.library.web.internal.display.context.DLAdminDisplayContextProvider.getDLAdminManagementToolbarDisplayContext(DLAdminDisplayContextProvider.java:64) ~[?:?]
      	at com.liferay.document.library.web.internal.portlet.action.DLViewMVCRenderCommand.render(DLViewMVCRenderCommand.java:102) ~[?:?]
      	at com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.render(MVCPortlet.java:282) ~[portal-kernel.jar:?]
      	at com.liferay.document.library.web.internal.portlet.DLPortlet.render(DLPortlet.java:81) ~[?:?]
      	at com.liferay.portlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:127) ~[portal-impl.jar:?]
      	at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:58) ~[portal-impl.jar:?]
      

      The error was reproduced in 7.4.13 U9

      Liferay Digital Experience Platform 7.4.13 Update 9 (Cavanaugh / Build 7413 / February 25, 2022)

      Attachments

        Activity

          People

            jeremy.chen Jeremy Chen
            peter.richards Peter Richards
            Kiyoshi Lee Kiyoshi Lee
            Alicia Garcia Alicia Garcia
            Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              24 weeks ago

              Packages

                Version Package
                7.4.3.22 CE GA22
                Master