Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-31595

Issue when using Repository.PageProvider with IN clause

    XMLWordPrintable

    Details

    • Release Notes Summary:
      NXQL page provider now works when org.nuxeo.web.ui.pageprovider.method is set to POST
    • Backlog priority:
      800
    • Sprint:
      nxplatform #80
    • Story Points:
      5

      Description

      When running a request like the following

      curl --location --request POST 'http://localhost:8080/nuxeo/api/v1/automation/Repository.PageProvider' \
      -H 'Content-type: application/json' \
      -d '{"params": { "providerName": "nxql_search", "pageSize": 40, "queryParams": "SELECT * FROM Document WHERE dc:contributors IN (\"Administrator\", \"npeacock\")"}}' \
      -u Administrator:Administrator
      

      with this configuration

      <extension target="org.nuxeo.runtime.ConfigurationService" point="configuration">
        <property name="org.nuxeo.web.ui.pageprovider.method">POST</property>
      </extension>
      

      the following error is seen

      Failed to invoke operation Repository.PageProvider with aliases [Document.PageProvider]
      .
      .
      .
      Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 2 out of bounds for length 2
      	at org.nuxeo.ecm.platform.query.nxql.NXQLQueryBuilder.getQuery(NXQLQueryBuilder.java:283) ~[nuxeo-platform-query-api-10.10-HF52.jar:?]
      	at org.nuxeo.ecm.platform.query.nxql.CoreQueryDocumentPageProvider.buildQuery(CoreQueryDocumentPageProvider.java:235) ~[nuxeo-platform-query-api-10.10-HF52.jar:?]
      	at org.nuxeo.ecm.platform.query.nxql.CoreQueryDocumentPageProvider.getCurrentPage(CoreQueryDocumentPageProvider.java:117) ~[nuxeo-platform-query-api-10.10-HF52.jar:?]
      	at org.nuxeo.ecm.automation.core.util.PaginablePageProvider.<init>(PaginablePageProvider.java:43) ~[nuxeo-core-io-10.10-HF66.jar:?]
      	at org.nuxeo.ecm.automation.jaxrs.io.documents.PaginableDocumentModelListImpl.<init>(PaginableDocumentModelListImpl.java:49) ~[nuxeo-core-io-10.10-HF66.jar:?]
      	at org.nuxeo.ecm.automation.core.operations.services.DocumentPageProviderOperation.run(DocumentPageProviderOperation.java:154) ~[nuxeo-automation-features-10.10-HF57.jar:?]
      

      The code has an issue with the comma in the IN clause

      If you're looking for the generic fix, please follow NXP-32067

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: