Filtering by `meta.status` doesn't work

Filtering by meta.status doesn’t work.

How to reproduce

I’m submitting a screen recording, see the here

Enviroment

Cloud w/ Business plan

Browser:

  • Chrome 81.0.4044.138

Thank you very much. Unfortunately I cannot reproduce it. Can you post the request that is sent as a XHR request to the API? Can you also try the predefined filters on the right side?

Predefined filters do work.

Here is the request and response from Chrome dev tools:

curl 'https://cloud.squidex.io/api/content/tru-prod/sales?q=%7B%22filter%22%3A%7B%22and%22%3A%5B%7B%22path%22%3A%22status%22%2C%22op%22%3A%22eq%22%2C%22value%22%3Anull%7D%5D%7D%2C%22sort%22%3A%5B%5D%2C%22take%22%3A50%7D' \
  -H 'authority: cloud.squidex.io' \
  -H 'pragma: no-cache' \
  -H 'accept: application/json, text/plain, */*' \
  -H 'authorization: Bearer <MyToken>
  -H 'accept-language: *' \
  -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36' \
  -H 'sec-fetch-site: same-origin' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-dest: empty' \
  -H 'referer: https://cloud.squidex.io/app/tru-prod/content/sales' \
  -H 'cookie: <cookie value>
  --compressed

Response:

{"total":0,"items":[],"statuses":[{"status":"Archived","color":"#eb3142"},{"status":"Draft","color":"#8091a5"},{"status":"Published","color":"#4bb958"}],"_links":{"self":{"href":"/api/content/tru-prod/sales","method":"GET"},"create":{"href":"/api/content/tru-prod/sales","method":"POST"},"create/publish":{"href":"/api/content/tru-prod/sales?publish=true","method":"POST"}}}

It is filtering against null:

{"filter":{"and":[{"path":"status","op":"eq","value":null}]},"sort":[],"take":50}

Strange: I cannot reproduce it :frowning:

I know what the problem is: The default value does not work. If you select ’ Archived’ manually it works fine.

1 Like