Forums

Private post edit bug?

  1. Hi,

    When trying to edit a post that was created as private, saving the post results in an error message in the iOS app ("Error occurred during saving") although the post is actually updated. Looking at the activity log, it appears that the post is being toggled as sticky for some reason, although I have not set the post to be sticky in the iOS app itself.

    The error is "Sorry, you cannot stick a private post.". I'm using the XML-RPC interface.

    Fixing the code to check for private status prior to calling _toggle_sticky in mw_editPost (class-wp-xmlrpc-server.php) seems to work, but it's not clear to me why given that the post shouldn't be sticky to begin with. I added this check for private post status, which fixes the problem:

    // Only posts can be sticky
    if ( $post_type == 'post' && isset( $content_struct['sticky'] ) && $post_status != 'private' ) {
        $data = $newpost;
        $data['sticky'] = $content_struct['sticky'];
        $data['post_type'] = 'post';
        $error = $this->_toggle_sticky( $data, true );
        if ( $error ) {
            return $error;
        }
    }

    The activity log reads:

    2018-11-05 21:34:40:903 🔵 Tracked: editor_post_update, properties: {
    "editor_source" = aztec;
    "has_gutenberg_blocks" = 0;
    "post_id" = 1157;
    "word_count" = 61;
    "word_diff_count" = 37;
    }
    2018-11-05 21:34:41:424 Error publishing post: Sorry, you cannot stick a private post.
    2018-11-05 21:34:41:426 !!! Attempted to create a revision of a revision
    2018-11-05 21:34:50:043 🔵 Tracked: editor_post_update, properties: {
    "editor_source" = aztec;
    "has_gutenberg_blocks" = 0;
    "post_id" = 1157;
    "word_count" = 84;
    "word_diff_count" = 37;
    }
    2018-11-05 21:34:50:610 Error publishing post: Sorry, you cannot stick a private post.
    2018-11-05 21:34:50:614 !!! Attempted to create a revision of a revision
    2018-11-05 21:35:03:525 🔵 Tracked: editor_post_update, properties: {
    "editor_source" = aztec;
    "has_gutenberg_blocks" = 0;
    "post_id" = 1157;
    "word_count" = 84;
    "word_diff_count" = 37;
    }
    2018-11-05 21:35:03:582 🔵 Tracked: editor_closed, properties: {
    "editor_source" = aztec;
    "has_gutenberg_blocks" = 0;
    "post_id" = 1157;
    }

    Thanks,
    Rob

  2. Minor correction, the actual error (as shown in the log) is "Sorry, you cannot stick a private post."

  3. Siobhan Bamber (siobhyb)
    Inactive
    Nov 7, 2018, 8:59 AM

    Hi Rob,

    Thank you for the report! I attempted to replicate the error by following these steps:

    1. Published a private, sticky post on a test site, while logged into a web browser.
    2. Opened the app and edited the private, sticky post.

    The above steps didn't result in an error for me, however. I wonder whether you could let me know if I'm missing any important detail to replicate this?

    It'd also be helpful if you could share details of your site with us. If you don't want to share those details publicly, you can contact us privately via Me > Help & Support > Contact Us within the app. Please be sure to reference this forum post if you do.

  4. Hi Siobhan,

    Thank you for the quick reply!

    The steps you took seem mostly correct, however I never published the post as being sticky (and from a UI and database perspective I don't believe a post can ever be both private and sticky). So the sticky flag wasn't never something I explicitly touched when creating a post either in the app or with the web browser.

    Here's another way that I was able to get a repro, all using the app:

    1. Connect to the site
    2. Press the + button on the bottom
    3. Create a post with random title and body text
    4. Tap Publish
    5. At the published blog posts screen, re-open the post by tapping Edit
    6. Tap the top-right ellipses dots
    7. Tap Visibility and choose Private. Tap Back
    8. Tap Update
    9. See the error

    I'm running Wordpress 4.9.8 on Windows with Apache 2.4.37 , MySQL 5.7.24, and PHP 7.2.11. The iOS app version is 11.0. I do not have Jetpack installed. I have disabled all plugins just in case they were interfering and the error still appears.

    What other details are you interested in?

    Thanks!

Leave a Reply

You must log in to post.


About this Topic