Skip to:
Content

BuddyPress.org

Ticket #6977: 6977-bp-activity-activity-01.patch

File 6977-bp-activity-activity-01.patch, 3.9 KB (added by DJPaul, 9 years ago)
  • src/bp-activity/bp-activity-admin.php

    diff --git a/src/bp-activity/bp-activity-admin.php b/src/bp-activity/bp-activity-admin.php
    index 1f64825..fb062d5 100644
    a b function bp_activity_admin_load() { 
    580580                if ( $error )
    581581                        $redirect_to = add_query_arg( 'error', (int) $error, $redirect_to );
    582582                else
    583                         $redirect_to = add_query_arg( 'updated', (int) $activity->id, $redirect_to );
     583                        $redirect_to = add_query_arg( 'updated', $activity->id, $redirect_to );
    584584
    585585                /**
    586586                 * Filters URL to redirect to after saving.
  • src/bp-activity/bp-activity-functions.php

    diff --git a/src/bp-activity/bp-activity-functions.php b/src/bp-activity/bp-activity-functions.php
    index caf506f..359953d 100644
    a b function bp_activity_new_comment( $args = '' ) { 
    26332633        }
    26342634
    26352635        // Check to see if the parent activity is hidden, and if so, hide this comment publicly.
    2636         $is_hidden = ( (int) $activity->hide_sitewide ) ? 1 : 0;
     2636        $is_hidden = $activity->hide_sitewide ? 1 : 0;
    26372637
    26382638        /**
    26392639         * Filters the content of a new comment.
  • src/bp-activity/bp-activity-template.php

    diff --git a/src/bp-activity/bp-activity-template.php b/src/bp-activity/bp-activity-template.php
    index b4240b2..ad746d1 100644
    a b function bp_activity_user_can_delete( $activity = false ) { 
    16521652                // Users are allowed to delete their own activity. This is actually
    16531653                // quite powerful, because doing so also deletes all comments to that
    16541654                // activity item. We should revisit this eventually.
    1655                 if ( isset( $activity->user_id ) && ( (int) $activity->user_id === bp_loggedin_user_id() ) ) {
     1655                if ( isset( $activity->user_id ) && $activity->user_id === bp_loggedin_user_id() ) {
    16561656                        $can_delete = true;
    16571657                }
    16581658
  • src/bp-activity/classes/class-bp-activity-activity.php

    diff --git a/src/bp-activity/classes/class-bp-activity-activity.php b/src/bp-activity/classes/class-bp-activity-activity.php
    index a4e82ba..da51587 100644
    a b class BP_Activity_Activity { 
    107107         * @since 1.1.0
    108108         * @var int
    109109         */
    110         var $hide_sitewide = false;
     110        var $hide_sitewide = 0;
    111111
    112112        /**
    113113         * Node boundary start for activity or activity comment.
    class BP_Activity_Activity { 
    708708
    709709                // Now fetch data from the cache.
    710710                foreach ( $activity_ids as $activity_id ) {
    711                         $activities[] = wp_cache_get( $activity_id, 'bp_activity' );
     711                        $activity                    = wp_cache_get( $activity_id, 'bp_activity' );
     712                        $activity->hide_sitewide     = (int) $activity->hide_sitewide;
     713                        $activity->id                = (int) $activity->id;
     714                        $activity->is_spam           = (int) $activity->is_spam;
     715                        $activity->item_id           = (int) $activity->item_id;
     716                        $activity->mptt_left         = (int) $activity->mptt_left;
     717                        $activity->mptt_right        = (int) $activity->mptt_right;
     718                        $activity->secondary_item_id = (int) $activity->secondary_item_id;
     719                        $activity->user_id           = (int) $activity->user_id;
     720
     721                        $activities[] = $activity;
    712722                }
    713723
    714724                // Then fetch user data.
  • src/bp-blogs/bp-blogs-activity.php

    diff --git a/src/bp-blogs/bp-blogs-activity.php b/src/bp-blogs/bp-blogs-activity.php
    index b822f50..143593e 100644
    a b function bp_blogs_sync_activity_edit_to_post_comment( BP_Activity_Activity $acti 
    830830        remove_action( 'transition_comment_status',     'bp_activity_transition_post_type_comment_status', 10, 3 );
    831831        remove_action( 'bp_activity_post_type_comment', 'bp_blogs_comment_sync_activity_comment',          10, 4 );
    832832
    833         if ( 1 === (int) $activity->is_spam && 'spam' !== $post_comment_status ) {
     833        if ( 1 === $activity->is_spam && 'spam' !== $post_comment_status ) {
    834834                wp_spam_comment( $post_comment_id );
    835835        } elseif ( ! $activity->is_spam ) {
    836836                if ( 'spam' === $post_comment_status  ) {