Skip to:
Content
Pages
Categories
Search
Top
Bottom

Duplicate activity entries when bbPress replies edited


  • S. Panda
    Participant

    @spanda

    Is there any way of preventing an activity entry being created with bbPress replies are edited? I see both new replies and editing replies generates a bbp_reply_created in the bp_activity table.

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

  • danbp
    Participant

    @danbp

    Hi @spanda,

    it’s a bbpress bug who remains since BP 2.0.
    A patch was provided 7 mounth ago but not applied in latest bbP (2.5.6).

    Note that the patch contains a bracket error: ( component ) ) { ). Remove { !

    Open wp-content/plugins/bbpress/includes/extend/buddypress/activity.php

    Remove or comment line 279 & 280 and replace by

    $existing = new BP_Activity_Activity( $activity_id ); 
     		if ( empty( $existing->component ) )

    save and you’re done.


    S. Panda
    Participant

    @spanda

    Thanks for the reply, unfortunately that patch didn’t help. Here’s what I have in wp-content/plugins/bbpress/includes/extend/buddypress/activity.php:

    	// Get the activity stream item, bail if it doesn't exist
    //  ===== BBPRESS BUG WHICH RETURNS DUPLICATE =====
    // ===== bbp_reply_created UPON EDITS                            =====
    //		$existing = bp_activity_get_specific( array( 'activity_ids' => $activity_id, 'show_hidden' => true, 'spam' => 'all', ) );
    //		if ( empty( $existing['total'] ) || ( 1 !== (int) $existing['total'] ) )
    // ===== END BUGGY CODE / START PATCH                    =====
    		$existing = new BP_Activity_Activity( $activity_id ); 
     		if ( empty( $existing->component ) )
    // ===== END PATCH                                                           =====
    			return null;
    		$existing = new BP_Activity_Activity( $activity_id ); 
     		if ( empty( $existing->component ) )
    		// Return the activity ID since we've verified the connection
    			return $activity_id;
    	}
    

    S. Panda
    Participant

    @spanda

    Oops. Never mind. I’m an idiot! Thank you so much for your help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Duplicate activity entries when bbPress replies edited’ is closed to new replies.
Skip to toolbar