Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-30806

Using OR Criterion in REST request results in "Bad Request" error

    XMLWordPrintable

Details

    • [3.0] - Sprint 17

    Description

      When OR Criterion is used inside REST call, it will fail with the response: "Bad Request, Invalid Criterion id <OR> in <AND>".

      This issue only occurs on eZ Platform 2.5.2 and onwards (works OK in 2.5.1).

      Steps to reproduce
      1. Clean installation of eZ Platform 2.5.2
      2. Make a request to REST API:
      Location: api/ezp/v2/views

      Method: POST

      Headers:
      Accept: application/vnd.ez.api.View+json; version=1.1
      Content-Type: application/vnd.ez.api.ViewInput+json; version=1.1

      Body:

      {
        "ViewInput": {
          "identifier": "test",
          "public": true,
          "LocationQuery": {
            "Criteria": {
              "OR": [
                {
                  "ContentTypeIdentifierCriterion": "article",
                  "ContentTypeIdentifierCriterion": "folder"
                }
              ]
            },
            "FacetBuilders": {},
            "Filter": {},
            "SortClauses": {},
            "limit": 1000,
            "offset": 0
          }
        }
      }
      

      Result

      {
          "ErrorMessage": {
              "_media-type": "application/vnd.ez.api.ErrorMessage+json",
              "errorCode": 400,
              "errorMessage": "Bad Request",
              "errorDescription": "Invalid Criterion id <OR> in <AND>",
      (...)
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            mateusz.bieniek@ibexa.co Mateusz Bieniek
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: