WordPress.org

Make WordPress Core

Opened 9 months ago

Closed 3 months ago

#41965 closed defect (bug) (invalid)

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

Reported by: 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 (1)

#1 @peterwilsoncc
3 months 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.

Note: See TracTickets for help on using tickets.