Skip to:
Content
Pages
Categories
Search
Top
Bottom

Double click on send button make duplicate post


  • maksanse
    Participant

    @maksanse

    Hello,
    I looked around for a solution about this issue, but couldn’t find it.

    My problem : When my users double click on “send” button, their post is sent twice.

    In my opinon, preventing that double post should be included in core, but I guess it isn’t (throttling is on with 10 seconds but don’t change anything).

    Do you have a suggestion or know a post that could help me here ?
    Could you consider adding this feature in bbpress core ? (Who wants this issue to be possible ?)

    Thank you !

Viewing 6 replies - 1 through 6 (of 6 total)

  • Robin W
    Moderator

    @robin-w

    part of the new topic check is for duplicates , not sure why your site isn’t.

    you get an error message of

    ‘Duplicate topic detected; it looks as though you’ve already said that.’


    maksanse
    Participant

    @maksanse

    Hello Robin and thank you for your answer.
    I made a test with only bbpress and twenty twenty one theme activated and the issue still occurs :

    1) Create a post and double click on the “send” button
    2) Your action creates 2 posts instead of one (the situation doesn’t seem handled by bbpress ?).

    Please have a look at the following video :
    http://www.loom.com/share/b5e083721cea47409a8c7c0ad769329f

    I guess anyone can encounter this situation because no theme or function was active in my test. Shouldn’t that be handled by the core ?

    Best regards


    Robin W
    Moderator

    @robin-w

    I am not a bbpress author, just someone who helps out here.

    Every website is unique, and this doesn’t happen on my test site – I have not seen this reported elsewhere as an issue, and the code has a duplicate function check in it.

    line 307 of includes/replies/functions

    /** Reply Duplicate *******************************************************/
    
    	if ( ! bbp_check_for_duplicate( array( 'post_type' => bbp_get_reply_post_type(), 'post_author' => $reply_author, 'post_content' => $reply_content, 'post_parent' => $topic_id, 'anonymous_data' => $anonymous_data ) ) ) {
    		bbp_add_error( 'bbp_reply_duplicate', __( '<strong>Error</strong>: Duplicate reply detected; it looks as though you’ve already said that.', 'bbpress' ) );
    	}

    I am not able to say why you are getting this.


    Robin W
    Moderator

    @robin-w

    Just had a thought and dug in the code further, the duplicate check doesn’t apply to those roles/users that can ‘throttle’

    // No duplicate checks for those who can throttle
    	if ( user_can( (int) $r['post_author'], 'throttle' ) ) {
    		return true;
    	}

    bbPress User Roles and Capabilities

    so default Keymaster and Moderator can post duplicates


    maksanse
    Participant

    @maksanse

    Thank you Robin for the digging in 👍
    I tried to reproduce this issue with a non admin user and the error message appeared…
    So I just can’t get how my users manage to duplicate their posts 😅

    Anyway, as it seems to be a vicious bug, I let that go… I just have to delete those post every 3 weeks, that is not such a big deal…

    Thank you for your help 🙏


    Robin W
    Moderator

    @robin-w

    you’re welcome 🙂

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Skip to toolbar