Skip to:
Content

BuddyPress.org

Ticket #5907: 5907.patch

File 5907.patch, 1.1 KB (added by imath, 12 years ago)
  • src/bp-activity/bp-activity-functions.php

    diff --git src/bp-activity/bp-activity-functions.php src/bp-activity/bp-activity-functions.php
    index 94b5de1..26dc9b8 100644
    function bp_activity_new_comment( $args = '' ) {  
    13501350
    13511351        $activity_id = $r['activity_id'];
    13521352
    1353         // Check to see if the parent activity is hidden, and if so, hide this comment publically.
     1353        // Get the parent activity
    13541354        $activity  = new BP_Activity_Activity( $activity_id );
     1355
     1356        // Bail if the parent activity does not exist
     1357        if ( empty( $activity->date_recorded ) ) {
     1358                return false;
     1359        }
     1360
     1361        // Check to see if the parent activity is hidden, and if so, hide this comment publically.
    13551362        $is_hidden = ( (int) $activity->hide_sitewide ) ? 1 : 0;
    13561363
    13571364        // Insert the activity comment
    function bp_activity_delete_comment( $activity_id, $comment_id ) {  
    16611668                                bp_activity_delete_children( $activity_id, $child->id );
    16621669                        }
    16631670                }
    1664                
     1671
    16651672                // Delete the comment itself
    16661673                bp_activity_delete( array(
    16671674                        'secondary_item_id' => $comment_id,