Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/10/2010 03:15:48 PM (15 years ago)
Author:
apeatling
Message:

Fixes #1862 - remove all child comments when deleting a comment.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-classes.php

    r2619 r2644  
    3939            $this->date_recorded = $row->date_recorded;
    4040            $this->hide_sitewide = $row->hide_sitewide;
     41            $this->mptt_left = $row->mptt_left;
     42            $this->mptt_right = $row->mptt_right;
    4143        }
    4244    }
     
    374376
    375377        /* Get all descendants of this node */
    376         $descendants = $wpdb->get_results( $wpdb->prepare( "SELECT id FROM {$bp->activity->table_name} WHERE type = 'activity_comment' AND secondary_item_id = %d", $parent_id ) );
     378        $descendants = BP_Activity_Activity::get_child_comments( $parent_id );
    377379
    378380        /* Loop the descendants and recalculate the left and right values */
     
    390392    }
    391393
     394    function get_child_comments( $parent_id ) {
     395        global $bp, $wpdb;
     396
     397        return $wpdb->get_results( $wpdb->prepare( "SELECT id FROM {$bp->activity->table_name} WHERE type = 'activity_comment' AND secondary_item_id = %d", $parent_id ) );
     398    }
     399
    392400    function get_recorded_components() {
    393401        global $wpdb, $bp;
Note: See TracChangeset for help on using the changeset viewer.