• Resolved skylex69

    (@skylex69)


    I’ve just updated from 2.6.4 because this old version isn’t compatible anymore with PHP 8.2 (scheduled revisions are missed due to a PHP error). The UI changes in v3 didn’t fit with my usage at first, but it’s been resolved now as it seems.

    But now when I try to submit a revision with any content change, the “Schedule revision” button (or “New revision” button if I don’t change the date) gets greyed out and nothing happens. But if I don’t touch the post content and click on “New revision” it works…

    I tried disabling some plugins that may interfere with this but no change.

    I don’t see any javascript error in the console.

    The only thing that happens is an autosave ajax query to admin-ajax.php with this result :

    {"wp_autosave":{"success":true,"message":"Brouillon enregistr\u00e9 \u00e0 20h\u00a045m\u00a027s."},"wp-auth-check":true,"server_time":1691693127}

    Same problem with the versions 3.4.1 and 3.5 of the plugin.

    Do you have any idea what could cause this?

    • This topic was modified 1 year, 6 months ago by skylex69.
Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter skylex69

    (@skylex69)

    *I meant updated from 2.6.3

    Plugin Support Riza Maulana Ardiyanto

    (@rizaardiyanto)

    Hi @skylex69

    Thanks for using PublishPress Revisions.

    Does change to another PHP version works for you?

    Thread Starter skylex69

    (@skylex69)

    Hi @rizaardiyanto,

    The same problem occurs with PHP 8.1.22 as with PHP 8.2.8. I can’t test with PHP <8.1 due to some dependencies requirements.

    But I don’t think it’s a PHP related issue as there’s no query going to the server when I click on the button, except for that autosave ajax query which doesn’t throw any PHP error in the logs.

    It looks like a javascript bug IMHO. But could be some kind of incompatibility with my WP setup.

    Can you confirm that this button is supposed to work fine with the latest version of the plugin? If, so I will dig deeper to find what could cause this in my setup.

    Thanks

    Plugin Support Riza Maulana Ardiyanto

    (@rizaardiyanto)

    @skylex69 Yes it should. I just tested and it works fine on our testing. You can see this video: https://www.loom.com/share/9c2d5762702b43408da7fd0a26bc9b0a

    This could be plugin conflicting. Have you tried test it with only PublishPress Revisions activated?

    Thread Starter skylex69

    (@skylex69)

    Thanks I’ve seen your video, but in fact we’re not using the block editor (Gutenberg) but the classic one, we change the post content and date and then click on “Schedule a revision” on the right side menu (the “Publish menu”).

    Thread Starter skylex69

    (@skylex69)

    Well I’ve just tested on a brand new WordPress install and it works fine. I’m gonna dig to find out what’s causing this issue in our main WordPress install.

    Thread Starter skylex69

    (@skylex69)

    I narrowed down the issue to the line 160 of rvy_post-classic-edit.dev.js :

    if (!wp.autosave.server.postChanged()) {

    Which returns “true” in my setup if I change any letter in the content. But does always return “false” in a brand new WP setup.

    Probably an autosave or heartbeat issue, I’m looking into it.

    Thread Starter skylex69

    (@skylex69)

    Well, after a deep dive into WP’s autosave code and many tests in a brand new WordPress install, I can conclude that this is a bug in WordPress Core. When you are editing a post in “Text mode” in the classical editor, the function wp.autosave.server.postChanged() always returns true, even after an autosave was successful.

    In fact, it’s very easy to reproduce:
    – open the editor on any post
    – change the post content in Text (not Visual) mode
    – wait for autosave to kick in (watch the editor status bar)
    – in the browser console type: wp.autosave.server.postChanged()
    – it will return true
    – switch to Visual mode editor
    – same command will return false (meaning “autosave” is OK)
    – switch back to Text mode editor
    – same command will return true again, even if you didn’t changed anything more

    At least now I know a workaround: use the Visual editor, or if the user is stuck after submitting a revision in Text mode: click on Visual mode then it gets unstuck and immediately submits the revision.

    Thread Starter skylex69

    (@skylex69)

    I submitted a bug on WP’s trac : https://core.trac.www.ads-software.com/ticket/59094

    Plugin Support Riza Maulana Ardiyanto

    (@rizaardiyanto)

    @skylex69 Apologies for the delay on weekends.

    Happy to hear you discovered and reported the bug on WordPress core.

    Your thorough investigation is highly valued by the WordPress community. ??

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Cannot schedule revisions’ is closed to new replies.