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

Unable to use DDM field in Custom Facet when it's not localizable: ArrayIndexOutOfBoundsException

Details

    • Community

    Description

      Related to https://issues.liferay.com/browse/LPS-123694

       

      Steps to reproduce

      1. create custom document or custom webcontent structure
      2. create custom field
      3. set 'Localizable' to No
      4. create document entry or custom web content based on structure
      5. check fieldname in Elasticsearch, e.g.:
        curl "localhost:9201/_search?q=entryClassName:com.liferay.document.library.kernel.model.DLFileEntry&pretty=true"

        (note: replace localhost:9201 with the correct machine and port, where elasticsearch server is located)

      6. field name is located in nested ddmFieldArray => ddmFieldName
      7. create a page with searchbar, searchresult
      8. search for newly created item
      9. now add custom facet widget and configure aggregation field (from step 6)
        • Expected behavior: The custom facet widget works correctly and displays correct facet data
        • Wrong behavior: Once you have saved it, the page will already show a broken widget if not try to search for the newly created item
          java.lang.ArrayIndexOutOfBoundsException: 1
          	at com.liferay.portal.search.web.internal.custom.facet.portlet.shared.search.CustomFacetPortletSharedSearchContributor.contributeWithNestedFacet(CustomFacetPortletSharedSearchContributor.java:115)
          	at com.liferay.portal.search.web.internal.custom.facet.portlet.shared.search.CustomFacetPortletSharedSearchContributor.contribute(CustomFacetPortletSharedSearchContributor.java:72)
          	at com.liferay.portal.search.web.internal.portlet.shared.search.PortletSharedSearchRequestImpl.lambda$getSearchSettingsContributor$3(PortletSharedSearchRequestImpl.java:203)
          	at com.liferay.portal.search.web.internal.search.request.SearchRequestImpl.lambda$buildSettings$2(SearchRequestImpl.java:132)
          	at java.lang.Iterable.forEach(Iterable.java:75)
          	at com.liferay.portal.search.web.internal.search.request.SearchRequestImpl.buildSettings(SearchRequestImpl.java:131)
          	at com.liferay.portal.search.web.internal.search.request.SearchRequestImpl.search(SearchRequestImpl.java:63)
          	at com.liferay.portal.search.web.internal.portlet.shared.search.PortletSharedSearchRequestImpl.doSearch(PortletSharedSearchRequestImpl.java:174)
          	at com.liferay.portal.search.web.internal.portlet.shared.search.PortletSharedSearchRequestImpl.lambda$search$0(PortletSharedSearchRequestImpl.java:76)
          	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          	at com.liferay.portal.search.web.internal.portlet.shared.task.PortletSharedTaskExecutorImpl.executeOnlyOnce(PortletSharedTaskExecutorImpl.java:67)
          	at com.liferay.portal.search.web.internal.portlet.shared.search.PortletSharedSearchRequestImpl.search(PortletSharedSearchRequestImpl.java:75)
          	at com.liferay.portal.search.web.internal.custom.filter.portlet.CustomFilterPortlet.render(CustomFilterPortlet.java:76)
          	at com.liferay.portlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:127)
          	at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:58)
          	at com.liferay.portlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:124)
          	at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:71)
          	at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:115)
          	at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
          	at org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153)
          

           

      As a work-around I have set the field to Localizable: Yes but took me some time to figure what was wrong.

      Attachments

        Issue Links

          Activity

            People

              brian.lee Brian Lee
              jan.verweij Jan Verweij
              Marta Elicegui Marta Elicegui
              Bryan Engler Bryan Engler
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                1 year, 33 weeks ago
                Development End Date:
                Development Start Date:

                Packages

                  Version Package
                  7.1.10 DXP FP26
                  7.1.10.7 SP7
                  7.1.X
                  7.2.10 DXP FP15
                  7.2.X
                  7.3.10.3 DXP SP3
                  7.3.X
                  7.4.13 DXP GA1
                  7.4.3.4 CE GA4
                  Master