Deleting a feature image becomes "" instead of null and breaks filter query
See original GitHub issueHello, I was trying to get all posts that have set a featured image.
{{#get "posts" limit="5" filter="id:-{{id}}+feature_image:-null"}}
First … I imported all the content from another blog. And the rule feature_image:-null
was ignored.
I created a new post without the featured image and the filter works. It doesn’t get the post. Then I set a featured image, saved the post, removed the featured image and saved again the post. Now the rule feature_image:-null
gets ignored and the query selects the new post, even if it doesn’t have an image.
So something is set in db instead of null
after the featured image gets removed.
I exported the json and checked the feature_image
value.
When I created the post the value was "feature_image": null
and it was good, but after I set the image and removed it, it became "feature_image": ""
.
This breaks the filter query.
P.S. In this url: https://api.ghost.org/docs/filter … it says filter="featured:true,image:-null"
and should, probably, be filter="featured:true,feature_image:-null"
and images:-null
shoud be feature_image:-null
- Ghost Version: 1.10.0
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
@kirrg001 the client behaviour can be changed but it’s probably something that needs to be enforced at the server level too along with a migration to ensure consistency between old and new posts
@kirrg001 No problem, I’m on local. Just testing 😄