-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
Post sort order #55
Comments
Perhaps your post "Volume Shadow Copy" is pinned? This would cause it to appear above other posts in the blog index and the admin area. The usual sort order for both blog and admin area is What happens to the sort order if you edit some of the other posts? |
....or maybe the sort problem is that the pinned field was not updated when the data was imported, and hence is null...and the update sets it to 0, and null comes before 0 in a sort |
Yes I think that may be the answer. Chyrp Lite will consider any “falsey” value as unpinned, but the database is prioritising null above 0 when it sorts the query results. The recent posts in the blog sidebar are not affected because the sort order for those results does not consider pinned status. |
I'll update the DB manually, setting 'pinned' to 0 everywhere. Might be an idea (if possible) to set pinned to 0 on import, if not specified in the import file. Thanks again |
Confirmed, with a 0 in all lines, the sort is correct |
Yes, I’m going to look into this later today. The import method is casting the pinned value from the XML document to boolean but the normal behaviour for added/updated posts is to cast the value to integer, and I think this is causing different handling when sent to the database. Thanks for the report! |
The thanks are mine ;) |
Fixes bad pinned status and incorrect updated_at value reported in issue #55.
Imported a list of posts from Chyrp.
Most-recent posts are listed at the top - this is fine.
Found a typo in the first post, edited it - leaving original timestamp. Save post.
It is now listed at the bottom (i.e. invisible). Also in admin, this post is last in the list.
Can posts be sorted automatically by timestamp descending?
The text was updated successfully, but these errors were encountered: