-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
Deleting a feature image becomes "" instead of null and breaks filter query #9085
Comments
Hey @NistorCristian! Using
Thanks will update our docs. Closing, because this is not a bug. Please wait for help in slack, thanks! |
As I said But it doesn't work after I do this: The problem is not really with the filter tag. Is more with the fact that when I delete the featured image the value in json for |
Okay i see what you mean. This affects all images, because the admin client sends an empty string instead of null. @kevinansfield Could we change this behaviour in the admin client? @NistorCristian I don't have a workaround for you, because our parser does not allow checking for empty strings. I have added a comment here. |
@kirrg001 No problem, I'm on local. Just testing 😄 |
@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 |
closes TryGhost#9085 Fixes an issue, where the client sets image properties to `""` after deleting the image. This causes problems with the query filter (see TryGhost/GQL#24), as they have to be `null`. Added a check in the model layer saving method to set value to `null`, when the property is empty. Affected models and properties: - `posts`: - `feature_image` - `og_image` - `twitter_image` - `users`: - `profile_image` - `cover_image` - `tags`: - `feature_image`
closes #9085 Fixes an issue, where the client sets image properties to `""` after deleting the image. This causes problems with the query filter (see TryGhost/GQL#24), as they have to be `null`. Added a check in the model layer saving method to set value to `null`, when the property is empty. Affected models and properties: - `posts`: - `feature_image` - `og_image` - `twitter_image` - `users`: - `profile_image` - `cover_image` - `tags`: - `feature_image`
Hello,
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, befilter="featured:true,feature_image:-null"
andimages:-null
shoud befeature_image:-null
The text was updated successfully, but these errors were encountered: