question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Deleting a feature image becomes "" instead of null and breaks filter query

See original GitHub issue

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, be filter="featured:true,feature_image:-null" and images:-null shoud be feature_image:-null

  • Ghost Version: 1.10.0

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kevinansfieldcommented, Oct 3, 2017

@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

0reactions
NistorCristiancommented, Oct 3, 2017

@kirrg001 No problem, I’m on local. Just testing 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using nullability in GraphQL
For output fields, removing non-null from a field is a breaking change. The first case is easy to understand: If an API consumer...
Read more >
Solved: Deleting/filtering every row with null values in e...
I wish to delete all the rows that have null values across all columns after the last row with data in it. How...
Read more >
SQLAlchemy: cascade delete - python - Stack Overflow
I noticed that most of the time I delete through session.query().filter().delete() (which doesn't put elements in the memory and deletes ...
Read more >
How to fix null values from unique metrics with filters
In Data Studio, you might encounter a situation where applying a filter to your chart causes unique metrics to return null values for...
Read more >
Tutorial: Add sorting, filtering, and paging with the Entity ...
In this tutorial you add sorting, filtering, and paging ... The following image shows what the page will look like when you're done....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found