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

Content Sets' Filter by field function doesn't work for documents

    Details

      Description

      Steps to reproduce:

      1. Start a bundle
      2. Go to the Document Types tab of the Documents and Media, create a new type
      3. Name it 'Report', add a select field with the 'Daily' and 'Weekly' options, Save it
      4. Upload two 'Report' documents, one of them should be 'Daily', and the other 'Weekly'
      5. Create a Dynamic Content Set in the Content Section -> Content Sets
      6. Name it Reports, Select Document -> Report
      7. Turn Filter by field on, select 'Daily', Save
      8. Put an Asset Publisher on a page, go to its configurations
      9. Select Collection -> Reports in the Asset Selection, save
      10. Check the Asset Publisher

      Expected behavior: Daily report should be visible there

      Actual behavior: Asset Publisher is empty, exception in the log (attached)

      Note:

      • Filter by field function works if you use it directly from the Asset Publisher -> Dynamic Asset selection
      • Filter by field in Content Sets works with Web Contents (structure with a select field)
      • Exception is thrown in DLFileEntryModelPreFilterContributor.addDDMFieldFilter(..), the value of ddmStructureFieldNameParts array is [ddm, 196616, Select4uf6_en_US] while the expected would be something like: [ddm, keyword, 196536, Select2e22_en_US]. This means the wrong string value gets converted to Long, which is invalid, and thus, 0.

      Error:

      2020-05-20 13:59:00.299 ERROR [http-nio-8080-exec-805][AssetListAssetEntryProviderImpl:739] Unable to get asset entries
      com.liferay.portal.kernel.search.SearchException: java.lang.RuntimeException: com.liferay.portal.kernel.search.SearchException: com.liferay.portal.kernel.exception.SystemException: com.liferay.dynamic.data.mapping.kernel.NoSuchStructureException: No DDMStructure exists with the primary key 0
              at com.liferay.portal.kernel.search.BaseIndexer.search(BaseIndexer.java:586)
              at com.liferay.asset.internal.util.AssetHelperImpl.search(AssetHelperImpl.java:444)
              at com.liferay.asset.list.internal.asset.entry.provider.AssetListAssetEntryProviderImpl._search(AssetListAssetEntryProviderImpl.java:732)
              at com.liferay.asset.list.internal.asset.entry.provider.AssetListAssetEntryProviderImpl._getDynamicAssetEntries(AssetListAssetEntryProviderImpl.java:626)
              at com.liferay.asset.list.internal.asset.entry.provider.AssetListAssetEntryProviderImpl.getAssetEntries(AssetListAssetEntryProviderImpl.java:146)
              at com.liferay.asset.list.internal.asset.entry.provider.AssetListAssetEntryProviderImpl.getAssetEntries(AssetListAssetEntryProviderImpl.java:128)
              at com.liferay.asset.publisher.web.internal.display.context.AssetPublisherDisplayContext.getAssetEntries(AssetPublisherDisplayContext.java:311)
              at com.liferay.asset.publisher.web.internal.display.context.AssetPublisherDisplayContext.getAssetEntryResults(AssetPublisherDisplayContext.java:416)
              at org.apache.jsp.view_jsp._jspService(view_jsp.java:689)
      ...
              at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
              at java.lang.Thread.run(Thread.java:748)
      Caused by: java.lang.RuntimeException: com.liferay.portal.kernel.search.SearchException: com.liferay.portal.kernel.exception.SystemException: com.liferay.dynamic.data.mapping.kernel.NoSuchStructureException: No DDMStructure exists with the primary key 0
              at com.liferay.portal.search.internal.permission.SearchResultPermissionFilterFactoryImpl._search(SearchResultPermissionFilterFactoryImpl.java:92)
              at com.liferay.portal.search.internal.permission.SearchResultPermissionFilterFactoryImpl.lambda$create$0(SearchResultPermissionFilterFactoryImpl.java:57)
              at com.liferay.portal.search.internal.permission.DefaultSearchResultPermissionFilter.getHits(DefaultSearchResultPermissionFilter.java:186)
              at com.liferay.portal.search.internal.permission.DefaultSearchResultPermissionFilter.search(DefaultSearchResultPermissionFilter.java:98)
              at com.liferay.portal.kernel.search.BaseIndexer.search(BaseIndexer.java:572)
              ... 243 more
      Caused by: com.liferay.portal.kernel.search.SearchException: com.liferay.portal.kernel.exception.SystemException: com.liferay.dynamic.data.mapping.kernel.NoSuchStructureException: No DDMStructure exists with the primary key 0
              at com.liferay.portal.kernel.search.BaseIndexer.getFullQuery(BaseIndexer.java:228)
              at com.liferay.portal.kernel.search.BaseIndexer.doSearch(BaseIndexer.java:1184)
              at com.liferay.portal.search.internal.permission.SearchResultPermissionFilterFactoryImpl._search(SearchResultPermissionFilterFactoryImpl.java:89)
              ... 247 more
      Caused by: com.liferay.portal.kernel.exception.SystemException: com.liferay.dynamic.data.mapping.kernel.NoSuchStructureException: No DDMStructure exists with the primary key 0
              at com.liferay.document.library.internal.search.spi.model.query.contributor.DLFileEntryModelPreFilterContributor.addDDMFieldFilter(DLFileEntryModelPreFilterContributor.java:171)
              at com.liferay.document.library.internal.search.spi.model.query.contributor.DLFileEntryModelPreFilterContributor.contribute(DLFileEntryModelPreFilterContributor.java:67)
              at com.liferay.portal.search.internal.indexer.PreFilterContributorHelperImpl.lambda$contribute$0(PreFilterContributorHelperImpl.java:79)
              at java.util.ArrayList.forEach(ArrayList.java:1255)
              at java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1080)
              at com.liferay.portal.search.internal.indexer.ModelPreFilterContributorsHolderImpl.forEach(ModelPreFilterContributorsHolderImpl.java:50)
              at com.liferay.portal.search.internal.indexer.PreFilterContributorHelperImpl.contribute(PreFilterContributorHelperImpl.java:77)
              at com.liferay.portal.search.internal.indexer.IndexerQueryBuilderImpl.addPreFiltersFromModel(IndexerQueryBuilderImpl.java:115)
              at com.liferay.portal.search.internal.indexer.DefaultIndexer.postProcessContextBooleanFilter(DefaultIndexer.java:209)
              at com.liferay.portal.search.internal.indexer.PreFilterContributorHelperImpl._addIndexerProvidedPreFilters(PreFilterContributorHelperImpl.java:101)
              at com.liferay.portal.search.internal.indexer.PreFilterContributorHelperImpl._createPreFilterForEntryClassName(PreFilterContributorHelperImpl.java:157)
              at com.liferay.portal.search.internal.indexer.PreFilterContributorHelperImpl.contribute(PreFilterContributorHelperImpl.java:62)
              at com.liferay.portal.search.internal.query.BaseIndexerPreFilterContributor.contribute(BaseIndexerPreFilterContributor.java:40)
              at com.liferay.portal.kernel.search.BaseIndexer._addPreFilters(BaseIndexer.java:1511)
              at com.liferay.portal.kernel.search.BaseIndexer.getFullQuery(BaseIndexer.java:213)
              ... 249 more
      Caused by: com.liferay.dynamic.data.mapping.kernel.NoSuchStructureException: No DDMStructure exists with the primary key 0
              at com.liferay.dynamic.data.mapping.internal.DDMStructureManagerImpl.translate(DDMStructureManagerImpl.java:400)
              at com.liferay.dynamic.data.mapping.internal.DDMStructureManagerImpl.getStructure(DDMStructureManagerImpl.java:242)
              at com.liferay.document.library.internal.search.spi.model.query.contributor.DLFileEntryModelPreFilterContributor.addDDMFieldFilter(DLFileEntryModelPreFilterContributor.java:123)
              ... 263 more
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              beck.liu Beck Liu
              Reporter:
              vendel.toreki Vendel Töreki
              Participants of an Issue:
              Recent user:
              David Gutiérrez Mesa
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 23 weeks, 3 days ago

                  Packages

                  Version Package
                  7.2.10 DXP FP7
                  7.2.X
                  7.3.3 CE GA4
                  7.3.10 DXP GA1
                  Master