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
Error: Undefined attribute level operator $and at applyOperator #20138
Comments
I found the error... It seems that in the 4.23.0 version of Strapi you have to include the "filters" attribute when you subquery into a related entity, so I change this:
to this:
In previos versions of Strapi the first code works well. |
In older versions like 4.16.2 the "filters" attribute in subquery does not work, it is a breaking change that should be specified in the documentation. https://docs.strapi.io/dev-docs/migration-guides |
I think this is a side effect of this PR: This is something that is also extremely hard to spot in you codebase, so even if this is something that was mentioned in the migration guides it would be really hard to fix this without checking every use of the filters. |
I completely agree. If this is intended, it should be flagged as a breaking change. Since there is nothing in the documentation, and it directly impacts the entire code base, it's likely to cause breakages. I’d like to know what is the Strapi team position in here before update our code base or wait until this is fix before upgrading to a newer version @derrickmehaffy 🦾🦾🦾 |
Will need @alexandrebodin to confirm. Outside my realm to say one way or the other. |
Hi, This was not an intended side effect, I'll correct it asap |
ℹ️ The fix has been released in 4.23.2 as a patch and will also be in the 4.24.1 release tomorrow |
Bug report
Required System information
Describe the bug
In the new version of Strapi (4.23.1) when we call to entityService.findMany we get the following error:
It is happen when you execute a subquery $and in a relation, in my case when I try to filter a relation bannerLocation with the "$and" operator.
Strapi dependencies
If I change all these dependencies to 4.22.1 it works as expected.
Steps to reproduce the behavior
Expected behavior
Success sql.
Screenshots
Code snippets
Code that execute the error:
The text was updated successfully, but these errors were encountered: