[wp-trac] [WordPress Trac] #5801: safety measure for cron to
publish future post
WordPress Trac
wp-trac at lists.automattic.com
Fri Feb 8 20:55:13 GMT 2008
#5801: safety measure for cron to publish future post
---------------------+------------------------------------------------------
Reporter: hailin | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone: 2.6
Component: General | Version:
Severity: normal | Keywords:
---------------------+------------------------------------------------------
Sometimes future posts were published before they were scheduled.
There could be two possible reasons:
1, time is off on the local web server. When time is off, it will trigger
publishing events ahead of time or ahead of time.
2. our publish future post logic is flawed.
We store future posts to be published in cron field in each blog's option
table. Theoretically, only post of type "future" can be stored there.
However, we have so many types of posts (including some legacy types), and
transitioning among them is not easy to guarantee to be 100% correctly
handled.
Debugging some blogs reveals that there is one post of type "draft" that
was included in the cron field in the options table. And to make matter
worse, when publish event is fired, we just happily publish the post, even
when the type is "draft". So this logic is wrong.
One possible fix is not to publish any post NOT of type "future". But I
figure that is too strict. For a safe fix, I only add logic to skip
publishing "draft" posts.
--
Ticket URL: <http://trac.wordpress.org/ticket/5801>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list