Project

General

Profile

Actions

Bug #4955

closed

First three posts on main page stuck

Added by Sarah Morgano almost 9 years ago. Updated almost 9 years ago.

Status:
Resolved
Priority name:
High
Assignee:
Daniel Jones
Category name:
Home Page
Target version:
Start date:
2015-11-28
Due date:
% Done:

0%

Estimated time:
Deployment actions:

Description

I noticed that the first two posts under Blogs on the main page have been the same for a few days. It looks like newer posts are showing underneath the two with timestamps. Perhaps a bug?

Actions #1

Updated by Sarah Morgano almost 9 years ago

  • Subject changed from First two posts on main page stuck to First three posts on main page stuck

Correction - it's the first three posts. Instead of a timestamp it says "sometime ago."

Actions #2

Updated by Matt Gold almost 9 years ago

  • Status changed from New to Assigned
  • Assignee set to Boone Gorges
  • Priority name changed from Normal to High

Thanks for the report, Sarah. I was just looking at this part of the page earlier today after one of my students posted something, but it didn't occur to me that the posts at the top were stuck.

Actions #3

Updated by Boone Gorges almost 9 years ago

  • Category name changed from Layout to Home Page
  • Target version set to 1.8.18

The "stuck" posts have timestamps that are in the future. This should not be happening. (a) WordPress should not allow a post to have the status 'publish' while having a post date in the future. (b) BuddyPress should not trust future dates when creating activity items.

It's straightforward enough for me to filter out blog post activity with future dates, but it doesn't address the root problem.

I've added Marilynn Johnson and Andy McKinney here as watchers, because each is an author of one of the problematic posts. (Andy: https://aardvarktest.commons.gc.cuny.edu/?p=418; Marilynn http://philosophy.commons.gc.cuny.edu/cfp-graduate-aesthetics-conference-due-jan-10/ and http://philosophy.commons.gc.cuny.edu/is-the-brain-bayesian-at-nyu-dec-4-5/). Andy and Marilynn, can you tell us anything about how you managed to publish (vs schedule) a future post? Did you do anything different when publishing these posts from what you normally do?

Dan (also added as a watcher), I have a strong feeling that your fix-missed-schedule plugin may be the culprit https://redmine.gc.cuny.edu/issues/4430#note-14. Can I ask you to do some testing? Most of the logic looks OK to me at a glance, but I'm not sure I understand the `true` parameter in `get_the_time()`. Could this be short-circuiting things? I'm wondering if `true` is resolving to 1 in get_post_time() -> get_post() -> WP_Post::get_instance() - this would return the Hello World post, which always has a post_date in the past. A cleaner way to do this whole thing may be to do a WP_Query with a date_query parameter.

For the time being, I will disable the missed-schedule cleanup tool, and write something that prevents future-dated items from showing up in activity streams.

Actions #4

Updated by Boone Gorges almost 9 years ago

  • Assignee changed from Boone Gorges to Daniel Jones

cac-fix-missed-schedule disabled in https://github.com/cuny-academic-commons/cac/commit/5e53ea983399e575ca34b34fb71bea49d16c9dfc

BP activity queries modded to prevent matching future-dated activity items in https://github.com/cuny-academic-commons/cac/commit/eb7cfc778c33496c9caa424529be5c7d2f131eff

Both fixes are deployed as hot fixes, and relevant caches cleared, so there should be no more immediate issues.

Dan, I'm turning this over to you for investigation.

Actions #5

Updated by Daniel Jones almost 9 years ago

Yes it looks like that "true" parameter was indeed the culprit! Removed it here - https://github.com/cuny-academic-commons/cac/commit/2c05716114634de09428c97733d4ccf3e70dd8cc

Sorry about that - I got confused between get_post_time() and get_the_time().

Actions #6

Updated by Raymond Hoh almost 9 years ago

  • Status changed from Assigned to Resolved

I've cherry-picked Dan's commit into 1.8.x branch and have re-implemented cac-fix-missed-schedule to 1.8.18.

We should keep an eye on this over the next week or so and if issues arise, let's reopen this ticket to look into this some more.

Actions #7

Updated by Marilynn Johnson almost 9 years ago

Hi Boone,

Thanks for catching this. I scheduled some posts in advance in the usual way and noticed they were either 1) going up immediately despite being scheduled for later or 2) going up early at strange times. (I had two posts that were scheduled days apart go up early together.) Hopefully it's resolved with this change. I will post here if I notice it's not on my site.

Thanks!
Marilynn

Actions

Also available in: Atom PDF