-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
🐛 Fixed known filter limitations #10159
Conversation
8106f1b
to
43f833d
Compare
refs #10105 - `options.where` is an older deprecated logic - before the filter language was invented, Ghost generates statements for knex - if we want to replace GQL with NQL, we can't generate these statements - they are not understood from NQL, because NQL uses mongo JSON - go through usages and rewrite the statements - invent `extraFilters` for now - we need to keep the support for `status` or `staticPages` for now (API requirement) - IMO both shortcuts in the extra filters should be removed in the future This commit is required for #10159!
7db2913
to
ee5ac5a
Compare
6cb2c17
to
a28ab4a
Compare
@gargol Could you pls work on getting rid of the functions The goal should be to enable existing test cases which used these two filters in the past. If you can't find a test case, add one for now as functional test. The test cases will be restricted by the functionality of mongo-knex.. You might need to adapt the filter plugin or the model layer to make them work. I will work on finishing up TryGhost/mongo-knex#16. |
Sure, starting on preProcessFilters and postProcessFilters now. |
- you need to install v0.2.0 mongo-knex
- extend existing test
- e.g. if you pass an unknown column -> filter=test:en
- we only tested simple cases e.g. you pass `filter=page:true` - but any complex use case e.g. like `filter=(page:true,page:false)` will result in a parse error - we have to simplify this behaviour
7644dca
to
fa24021
Compare
Travis is failing because of a random failure, tracked in #7470 again 🤨 |
refs #10105 - `options.where` is an older deprecated logic - before the filter language was invented, Ghost generates statements for knex - if we want to replace GQL with NQL, we can't generate these statements - they are not understood from NQL, because NQL uses mongo JSON - go through usages and rewrite the statements - invent `extraFilters` for now - we need to keep the support for `status` or `staticPages` for now (API requirement) - IMO both shortcuts in the extra filters should be removed in the future This commit is required for TryGhost/Ghost#10159!
refs #10105 - `options.where` is an older deprecated logic - before the filter language was invented, Ghost generates statements for knex - if we want to replace GQL with NQL, we can't generate these statements - they are not understood from NQL, because NQL uses mongo JSON - go through usages and rewrite the statements - invent `extraFilters` for now - we need to keep the support for `status` or `staticPages` for now (API requirement) - IMO both shortcuts in the extra filters should be removed in the future This commit is required for TryGhost/Ghost#10159!
refs #10105, closes #10108
Tasks
order =
(SELECT count(*) FROM posts_tags WHERE post_id = posts.id) DESC, ${order};
is tested wellextraFilters
fn in Ghost (check public context!) -> not needed, see commit