Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 5 years ago

#41965 closed defect (bug) (invalid)

WP Cron job not created for future scheduled post (causing Missed Schedule situation later)

Reported by: andersheie's profile andersheie Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords:
Focuses: Cc:

Description

Under these special circumstances, when setting a Future Scheduled date, no WP Cron job is created for the post. It should be noted this happens quite a lot on a daily basis as this is the process I use to create posts.

I have about 16 already scheduled future posts pending.

A) Add a new post 3 days in the future using rest API V2, in draft. – No WP Cron job is scheduled (Which is expected, as in draft mode).

B) Edit the post. Change the date one day backwards BUT DO NOT PRESS OK. Press “Schedule” instead. The post date changes, and the page reloads, but no WP cron job was added (FAIL).

C) Continue to edit the post and change the date back and forth (between future dates, don't press OK, just press 'schedule' each time. This failed twice for me on my little test.

I ran this sequence 6 times, it failed 2 times using step AB and twice on subsequent updates, so in half an hour it was fairly easy to reproduce, but not consistent unfortunately.

Please let me know if you need more information. I doubt that adding the post via REST API is the problem, more likely I would guess it's some schedule update issue, particularly since I was able to see this changed the date long after A and B were performed.

Btw, I'm using WP-Crontrol plugin to check the scheduled tasks.

Change History (2)

#1 @peterwilsoncc
7 years ago

  • Component changed from Cron API to Posts, Post Types
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed
  • Version 4.8.2 deleted

Welcome to trac, I'm sorry for the delayed response.

I've tested this using the WordPress Backbone REST API client and am unable to reproduce.

The steps I followed were:

  • create and save a draft post via the rest API.
    pwcc = new wp.api.models.Post( { title: 'Draft via REST API', status: 'draft', date: '2018-05-01 00:00:00' } );
    pwcc.save();
    
  • modify the date and schedule the post per step B above.

I'm going to close this ticket of for now as invalid (which is trac's unfriendly term for unable to reproduce), feel free to add further details to the ticket if needs be.

#2 @archon810
5 years ago

This is a bug with WP cron. I filed https://core.trac.wordpress.org/ticket/49520 because I strongly think WP cron should be resolved properly once and for all.

Note: See TracTickets for help on using tickets.