Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with filter on api (Global Query Parameters) #8607

Closed
3 tasks done
f-g-s-e opened this issue Oct 7, 2021 · 1 comment
Closed
3 tasks done

Problem with filter on api (Global Query Parameters) #8607

f-g-s-e opened this issue Oct 7, 2021 · 1 comment
Labels

Comments

@f-g-s-e
Copy link

f-g-s-e commented Oct 7, 2021

Preflight Checklist

Describe the Bug

I'm experiencing an unexpected behavior with filtering on api requests. See the section "To Reproduce" for more details.

To Reproduce

  • Create a collection named coll_a, with a text field field_a
  • Create a collection named coll_b, with a text field field_b
  • Create a collection named coll_c, with a text field field_c
  • Create a one to many relation form coll_a to coll_b, with a field on coll_a named rel_o2m_with_b and a field named rel_m2o_with_a on coll_b
  • Create a one to many relation form coll_b to coll_c, with a field on coll_b named rel_o2m_with_c and a field named rel_m2o_with_b on coll_c.

When I try this request GET /items/coll_a?filter[rel_o2m_with_b][field_b][_eq]="b 1", I get all items from collection coll_a that have a relation with an item in collection coll_b with the field field_b equal to "b 1". But when I try this request
GET /items/coll_a?filter[rel_o2m_with_b][rel_o2m_with_c][field_c][_eq]="c 1", I expect to get all items from collection coll_a that have a relation with an item in collection coll_b, that have a relation with an item in collection coll_c with the field field_c equal to "c 1", but what I get are all the items from coll_a, no matter what are the conditions expressed with the filter.

What version of Directus are you using?

v9.0.0-rc.95

What version of Node.js are you using?

v16.8.0

What database are you using?

mysql

What browser are you using?

chrome

What operating system are you using?

windows

How are you deploying Directus?

locally

@Oreilles
Copy link
Contributor

I just tried to replicate this on 9.5.1 and it seems the issue have been fixed, the filters are returning expected results on my end.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants