WordPress.org

Ready to get started?Download WordPress

Forums

BuddyPress Docs
Docs Trashing Themselves (19 posts)

  1. elemunjeli
    Member
    Posted 10 months ago #

    I've set up a set of wikis on the DemocracyLab site under the main menu item Collaborate>Discuss>

    The docs have twice put themselves into the trash, once all docs, and the second time only three of them. This is not my imagination, but has occurred with other installations as evidenced by this post: http://commonsinabox.org/groups/ciab-pioneers/forum/topic/docs-wandering-in-to-the-trash/

    Besides being bizarre, it's really a deal breaker on the plugin. I can't determine at all what would be causing it since the events are happening without any interaction with the docs which have never yet been edited or handled by myself or other users, they're newly created. I can give a tech login to someone contributing on the git if that would help investigate. Or, since I'm a developer myself, if you have tests or code you want me to look at let me know.

    DemocracyLab is hosted at OSUOSL (Oregon State University's Open Source Lab) and they are very helpful on the server side as well.

    http://wordpress.org/plugins/buddypress-docs/

  2. mrdale1958
    Member
    Posted 10 months ago #

    I have seen the same issue. No rhyme or reason as far as I can see.

  3. elemunjeli
    Member
    Posted 10 months ago #

    Five docs trashed themselves again, and are saying they are being edited by me when I'm not logged in.

  4. Boone Gorges
    Moderator
    Plugin Author

    Posted 10 months ago #

    Thanks for the report. This is the first I've heard of the issue.

    I'm going to comb through to attempt to locate possible problem points, but in the meantime, some questions to attempt to figure a pattern:

    - What other plugins are you using? Are you running Commons In A Box?
    - Does the problem only happen with non-admin users?
    - Does the problem only happen with docs that are/are not associated with a group?
    - Does the problem only happen with Docs of a certain privacy level?
    - Does it happen when someone tries to create the doc, when the docs are edited, or is it really happening when no one has touched the doc at all?

  5. mrdale1958
    Member
    Posted 10 months ago #

    - What other plugins are you using?
    Pretty vanilla commons in a box
    - Are you running Commons In A Box
    yes but despite recent grumblings I've heard I don't think it has happened since the xbox 1.0.5 update. I just did a tour of all the sites in the femtechnet network and I don't see anything in the Trash that doesn't belong there. Maybe the answer is "Update the buddy press docs plugin to current."
    - Does the problem only happen with non-admin users?
    Probably but at the time I was seeing it admins weren't doing much if any doc editing/creating
    - Does the problem only happen with docs that are/are not associated with a group?
    no
    - Does the problem only happen with Docs of a certain privacy level?
    not sure, they *might* have been a mixture of public and private groups certainly no hidden ones
    - Does it happen when someone tries to create the doc, when the docs are edited, or is it really happening when no one has touched the doc at all?
    I think it was happening soon after they had created the doc but after they had saved and gone on to other tasks

  6. elemunjeli
    Member
    Posted 10 months ago #

    I'm not running commons in a box.

    I'm using the most recent version of BP.

    I'm the only one who has touched the docs: they were just created and no other user has accessed the system so far, I am an admin.

    The docs are not associated with a group.

    All the docs are public, editable only by logged in users.

    It is happening when I haven't touched the docs at all. I see it within 24 hours, and it seems to be progressive. I've seen the docs show an error message that they can't be edited because I am editing them, when in fact I'm not even logged in. When I restore the docs they are marked as drafts and need to be published.

    I'm running Ninja Forms, including the Save User Progress extension, and we've done some troubleshooting on the php.ini for a very long form over the last couple days. I suspect that is the root of the problem.

    Other than that, there's an events plugin, Akismet, and SI CAPTCHA.

    If you have some thought as to how to log the event I can put a script on the server, or give you Tech access if you contact me privately. http://munjelifotobox.com/contact/

  7. Boone Gorges
    Moderator
    Plugin Author

    Posted 10 months ago #

    Thanks to both of you for your feedback. Doesn't sound like we're any closer to finding the actual cause, but some things have been ruled out, so thanks.

    As a next step, here's a little script that may help us to track down the problem. Put it in a file in wp-content/mu-plugins/ (doesn't matter what you call it - maybe wp-content/mu-plugins/bpdocsdebug.php):

    <?php
    function bbg_debug_doc_trash( $new_status, $old_status, $post ) {
        if ( 'bp_doc' == $post->post_status && 'trash' == $new_status ) {
            update_option( 'bbg_debug_doc_trash', json_encode( debug_backtrace() ) );
        }
    }
    add_action( 'transition_post_status', 'bbg_debug_doc_trash', 9999, 3 );

    Then, next time you notice the problem happen, look in your wp_options table for an item with option_name 'bbg_debug_doc_trash'. Send the option_value to me privately, or post it here with any necessary path obfuscation. Thanks!

  8. elemunjeli
    Member
    Posted 10 months ago #

    Thanks Boone. I'll run it, but for the record, the docs haven't trashed themselves within the last 24 hours - since the php.ini file was updated to support a larger max_input_vars and other fields. This was a requirement of a long form we were using on the site. I'll let you know if I see any other issues. I will be messing around with the form (to write a postback script) so if it continues and is related we may spot it.

    Ele

  9. elemunjeli
    Member
    Posted 10 months ago #

    Your script crashed my site. The event is happening as I post: I can see most of the docs are being edited by me although I'm not logged in. I can't log it since if I load your script in mu-plugins the site won't load (I'm getting a 503 server error).

    Next?

  10. elemunjeli
    Member
    Posted 10 months ago #

    A clue: the admin bar disappeared, and I just had a white space at the top of the page. When I logged in the issue seemed to resolve itself: I stopped getting a message that I was editing the docs. Logged out: the docs are showing me editing. They haven't trashed themselves yet though.

    I'm not sure the error was a 503 actually on the script, it just said the page wouldn't load btw.

  11. elemunjeli
    Member
    Posted 10 months ago #

    It's definitely got to do with the login. Although the docs are all marked as 'logged in users' can edit, when I logout, it shows me editing. However the doc also lets me edit, and when I save, it shows me logged out and the admin bar reappears.

  12. Boone Gorges
    Moderator
    Plugin Author

    Posted 10 months ago #

    Not sure why the script is crashing the site. Something must have happened with your copy and paste.

    That said, there was a typo in my original script that would cause it not to work (but certainly not to crash). The emended version:

    <?php
    function bbg_debug_doc_trash( $new_status, $old_status, $post ) {
        if ( 'bp_doc' == $post->post_type && 'trash' == $new_status ) {
            update_option( 'bbg_debug_doc_trash', json_encode( debug_backtrace() ) );
        }
    }
    add_action( 'transition_post_status', 'bbg_debug_doc_trash', 9999, 3 );

    I've just verified this on a number of installations and it does record. It's possible that your PHP install doesn't have JSON support available or something like that; your error logs (or WP_DEBUG) would probably tell you what's causing the fatal error.

    Without more details on the backtrace, I'm afraid there's little more that I can do. I've combed through the codebase of Docs pretty thoroughly and nothing is jumping out at me that might be causing this problem. So, hopefully you or another person experiencing the problem is able to get my tracer script to work. Thanks for trying.

  13. Boone Gorges
    Moderator
    Plugin Author

    Posted 10 months ago #

    The fact that the admin bar is not appearing says to me that PHP is experiencing a fatal error at some point near the end of execution - probably somewhere in the footer, just before the admin bar is rendered. I'd recommend checking the error logs, or enabling WP_DEBUG in wp-config.php, to see if you can get the beginnings of an explanation. It's not clear to me how this sort of problem would cause Docs to be trashed (after all, if PHP stops executing altogether, how would it send a Doc to the trash?), but it could be related.

  14. elemunjeli
    Member
    Posted 10 months ago #

    I recognized the <?php typo on the original and fixed it but didn't alter anything else. Now however, I copy-pasted your new code and the script is running. So we shall see. The docs haven't thrown themselves away yet. Maybe in the morning. I'll let you know.

  15. Boone Gorges
    Moderator
    Plugin Author

    Posted 10 months ago #

    Thanks :)

  16. elemunjeli
    Member
    Posted 10 months ago #

    They started throwing themselves away at midnight. I'll send you the trace tomorrow I'm not working today. But we got it. Naughty naughty docs.

  17. Boone Gorges
    Moderator
    Plugin Author

    Posted 10 months ago #

    Hi elemunjeli - Have you had a chance to look at the logged stack trace? I'm going to release a new version of the plugin soon, and it would be great to have a fix for this issue, but first I have to identify it :)

  18. elemunjeli
    Member
    Posted 10 months ago #

    Heya. I just emailed (to the email on your site) the dump from the option_value column in the options table. Let us know what you find.

  19. Boone Gorges
    Moderator
    Plugin Author

    Posted 10 months ago #

    Thanks very much for the email, elemunjeli. I have an educated guess, based on the content of the trace you sent me, that a plugin conflict is taking place, which is causing the URL parameter 'delete' to show up when it shouldn't. This, in turn, is triggering Doc deletion when it shouldn't.

    There are a couple of things I can and will put into Docs 1.5 to prevent this sort of thing - and I will ask you to test them when I've put them in place - but in the meantime, I'd like just a little bit more data to verify my educated guess. Could I ask you to repeat the experiment with the following modified script?

    <?php
    function bbg_debug_doc_trash( $new_status, $old_status, $post ) {
        if ( 'bp_doc' == $post->post_type && 'trash' == $new_status ) {
            global $wp_query;
            $v = array( $wp_query, $_SERVER );
            update_option( 'bbg_debug_doc_trash', json_encode( $v ) );
        }
    }
    add_action( 'transition_post_status', 'bbg_debug_doc_trash', 9999, 3 );

    Run this, and send me results as soon as you get them. Hopefully this'll be enough to confirm the issue, and point me toward exactly what combination of plugins, etc is causing the problem.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags