WordPress.org

Ready to get started?Download WordPress

Forums

Edit Flow
[resolved] EditFlow and post_date_gmt (16 posts)

  1. berkeleypa
    Member
    Posted 1 year ago #

    We've been having sporadic issues with posts being published suddenly before their scheduled date. Upon inspection of the database I noticed that post_date and post_date_gmt in the wp_posts table were off by more than 5 days, rather than the expected 7 or 8 hours (I'm on pacific time). I queried the database for other such instances and found that in not quite a year there were 70 instances of the two fields differing my many days. Other WP sites that I maintain do not use EditFlow and also don't have this discrepancy, so I suspect it is the culprit for posts being published prematurely - can anyone shed light on this?

    Thanks!

    http://wordpress.org/extend/plugins/edit-flow/

  2. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 1 year ago #

    Odd. It does sounds like it could be Edit Flow-related, and my primary suspect are these two filters.

    Have you been able to track down steps to reproduce reliably? Any special details about your server environment, or other plugins you might be running?

  3. berkeleypa
    Member
    Posted 1 year ago #

    Thanks for your reply. We have multiple authors and several have reported that when they create a new post, and come back to it later to edit, clicking the "Schedule" button causes it to publish immediately rather than schedule the time to publish. We do make use of custom statuses so often the post is left in one of those states. When this happened last I looked at the database and noticed that for that particular post the post_date_gmt was actually 5 days earlier than post_date, which I thought was very odd.

    Our site is hosted by WP Engine, a managed WordPress hosting service. I do think it has to do with EditFlow, since it doesn't happen with any of our other sites.

    Do you have a suggestion as to how we implement those filters?

    thanks!

  4. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 1 year ago #

    When this happened last I looked at the database and noticed that for that particular post the post_date_gmt was actually 5 days earlier than post_date, which I thought was very odd.

    Could this have been when the post was originally created? It sounds awfully similar to this issue, which I suspect is due to replication lag or something similar.

  5. mad283
    Member
    Posted 1 year ago #

    Hi. I have the exact same problem, but I've noticed it only happens if I move the post in the calendar. I mean, if I change the publishing date dragging & dropping the post on a different day then the original, the date doesn't actually change even if in the editing window the new date shows up and in the calendar the post appears in the new day.

  6. berkeleypa
    Member
    Posted 1 year ago #

    I think you're onto something mad283. Our authors tend to use the calendar to drag and drop posts too. I just tried this with a test post created today - dragged it to 3 days in the future then in the editing screen clicked Schedule, and sure enough, it published! It's like the post date is getting "stuck" on the date/time you create it when using the calendar to schedule.

  7. berkeleypa
    Member
    Posted 1 year ago #

    Hi Daniel - did you find a workaround for this issue?

  8. Connor Jennings
    Member
    Posted 1 year ago #

    I can also confirm some issues with scheduling posts on the calendar. Looking into it now.

  9. Connor Jennings
    Member
    Posted 1 year ago #

    If anyone can confirm the following steps to reproduce, that'd be most awesome.

    Steps to reproduce:
    1) Create a new post. Save it as is (do not publish or schedule).
    2) Go to the calendar and move the post a day or more forward
    3) Go back to the post. The publish button should say "Publish," but if you click on the "edit" link next to "Publish immediately" you should see the correctly scheduled date displayed.
    4) Hit "ok" and the publish button should now say "Schedule"

  10. berkeleypa
    Member
    Posted 1 year ago #

    @cojennin: I can confirm your steps exactly. The problem lies in that when you click Schedule it then publishes right away. Does that happen for you?

  11. mad283
    Member
    Posted 1 year ago #

    Yes, that's exactly what happens. But only if you I also drag & drop the post in the calendar.

  12. mad283
    Member
    Posted 1 year ago #

    One more thing: if, after having draggeg and dropped a post in the calendar, I change the pubblishing date in the editing window, that sticks and the post doesn't get pubblished immediately.

  13. berkeleypa
    Member
    Posted 1 year ago #

    Yes, you're right mad283. Curious thing is on steps 3 and 4 above, the correct date is shown, but if you click OK (without changing the date) it still says "Publish immediately" instead of the date. It seems that dragging the post to a new date in the calendar should actually cause it display the date instead of "Publish immediately", so therein lies the bug.

  14. berkeleypa
    Member
    Posted 1 year ago #

    Found the solution here: http://editflow.org/features/calendar/

    ef_calendar_allow_ajax_to_set_timestamp (filter) - Whether or not dragging an unpublished post to a new date changes the publication timestamp for the post. This is off by default. You can enable it by placing the following in your theme’s functions.php file:

    add_filter( 'ef_calendar_allow_ajax_to_set_timestamp', '__return_true' );

  15. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 1 year ago #

    @berkeleypa I think that's a partial fix. If you add the filter, it will change the behavior of the calendar to set the publication timestamp for the post if you drag the post. This will at least make it more obvious the timestamp isn't what it should be.

    The default behavior is broken I think. The way it's supposed to work is that you can drag the posts on the calendar, but it shouldn't affect the publication date of the post (which it seems to be doing).

  16. berkeleypa
    Member
    Posted 1 year ago #

    @Daniel yes but this is the behavior that we are expecting, that when you drag a post from one date to another, the date of publication should change accordingly. Otherwise how does the new date come into play? It does seem to be saved somewhere in the database, but both post_date and post_date_gmt were sticking to the original date on which the post was created, which was causing the premature publishing problem.
    Hope that's clear. Thanks for your help!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic