WordPress.org

Ready to get started?Download WordPress

Forums

Wordbooker
[resolved] Per post settings forgotten - intermittent (20 posts)

  1. dreamfoundry
    Member
    Posted 3 years ago #

    By default I have "Publish Post to Facebook" disabled as I don't want all posts published.

    When I create a post I want published I then enable "Publish Post to Facebook" and set the "Facebook Post Attribute line". I then either save to drafts, or schedule the post.

    When I then leave the page and come back, these settings have often unset themselves. Sometimes they stay set, but if I come back and edit the post at a later stage they often come unset when I save.

    This leads to a lot of situations where my scheduled post is published, but not pushed to Facebook.

    http://wordpress.org/extend/plugins/wordbooker/

  2. Steve
    Member
    Plugin Author

    Posted 3 years ago #

    Which version of the plugin are you using?

  3. dreamfoundry
    Member
    Posted 3 years ago #

    I have 1.8.16. This has, however, been happening for some while.

  4. Steve
    Member
    Plugin Author

    Posted 3 years ago #

    There was a bug in a previous version where it didn't save settings properly when you saved a draft but I thought I'd fixed it.

  5. dreamfoundry
    Member
    Posted 3 years ago #

    Any ideas of how I can fix this?

    Currently I have to go to posts page and reload post to see if the settings were saved properly. (Simply refreshing the posts page will always show the tick box ticked.)

  6. Steve
    Member
    Plugin Author

    Posted 3 years ago #

    The bug was such that where options that were turned on at the blog or user level on the options screen remained on even if you turned them off at the post level.

    If the posts were made before Wordbooker was installed then they wont by default have any settings so should inherit the current blog/user level settings.

    The only way to fix it is to go to each post that has not yet been published, double check the settings and update the post

  7. dreamfoundry
    Member
    Posted 3 years ago #

    These are all posts made after Wordbooker was installed.

    I also just managed to reproduce the error. Here is the sequence of events.

    1) I open a scheduled post and check that the settings are still set. They are. I then save click Update.

    2) I go back to the posts page.

    3) I re-open the post. The settings are still set. I click update again.

    4) I go back to the posts page.

    5) I re-open the post. The "Publish Post to Facebook" check box is not checked any more. The "Facebook Post Attribute line" is now also empty.

    This does not always happen after two saves. Sometimes one, sometimes ten, but it means I always have to go back and check or risk not having the post published to Facebook.

  8. Steve
    Member
    Plugin Author

    Posted 3 years ago #

    OK, thats very odd - I'll try to reproduce it here. Its odd because it would suggest that the post_meta is not getting pulled back properly.

  9. dreamfoundry
    Member
    Posted 3 years ago #

    I've been doing more experimentation. Seems I was slightly wrong.

    Seems the data is lost in the following circumstance (might be the same though):

    1) I open the post, and close without updating.

    2) I open the post, WP creates an autosave, I close with/without saving.

    Just for the record, I use the "Revision Control" plugin to limit revisions to the latest 10. I'm going to disable it now and see if the problem persists.

  10. dreamfoundry
    Member
    Posted 3 years ago #

    Okay, just disabled the "Revision Control" plugin, but the problem persists.

    It does, however, seem as if the settings are lost each time WP creates an autosave. If I just open the post and close and open again the settings are fine, but if I leave it for long enough to create an autosave it loses the settings.

  11. Steve
    Member
    Plugin Author

    Posted 3 years ago #

    OK - so basically the code doesn't fire on Autosave.... that gives me something to work on.

  12. Steve
    Member
    Plugin Author

    Posted 3 years ago #

    It looks like its a oddity in how Autosave works - so I'll need to do a little bit of coding to get round it.

  13. Steve
    Member
    Plugin Author

    Posted 3 years ago #

    Actually its a huge bug in autosave... custom post meta data isn't included in the $_POST when autosave fires.

  14. dreamfoundry
    Member
    Posted 3 years ago #

    Bummer. :/

    Anyway, I can confirm that if I disable the Autosave function the problem goes away.

  15. Steve
    Member
    Plugin Author

    Posted 3 years ago #

    I've asked on the WP forums to see if there is some way round this... or if its been reported as a bug/defect.

    However I've made a change to my code which means that if its an autosave it doesn't do anything - so all that will happen is that any changes to Wordbooker options on that post since the last save will be lost, rather than everything.

  16. dreamfoundry
    Member
    Posted 3 years ago #

    Thanks. I was about to suggest that. ;)

    Could you let me know which lines to change in your plugin, or will you be pushing some new code on the the server soon?

  17. Steve
    Member
    Plugin Author

    Posted 3 years ago #

    I'll push a new version as I found a couple of other things that really needed tidying up at the same time

    But a quick dirty fix is to find

    function wordbooker_future_post($newstatus, $oldstatus=null, $post=null) {

    and add on the next line:

    if ($_POST['action']=='autosave') { return;}
  18. dreamfoundry
    Member
    Posted 3 years ago #

    Thanks. :)

  19. Steve
    Member
    Plugin Author

    Posted 3 years ago #

  20. dreamfoundry
    Member
    Posted 3 years ago #

    It works. The settings are retained after autosave. :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags