Skip to:
Content

BuddyPress.org

Changeset 11414


Ignore:
Timestamp:
02/06/2017 07:36:10 PM (8 years ago)
Author:
r-a-y
Message:

Activity Admin: Ensure activity comment depth check is respected.

For blog activity comment replies, we need to change the operator to
"greater or equal to" for the depth check to be accurate, due to activity
items being displayed in stream mode.

For regular activity comment replies, we need to add our activity comment
reply check to BP_Activity_List_Table::can_comment(). This can be
further optimized by moving this out of the Blogs component check in a
later release.

See #7329.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/classes/class-bp-activity-list-table.php

    r11366 r11414  
    808808            } elseif ( 'activity_comment' === $item['type'] ) {
    809809                $parent_activity = new BP_Activity_Activity( $item['item_id'] );
     810                $can_comment     = bp_activity_can_comment_reply( (object) $item );
    810811            }
    811812
  • trunk/src/bp-blogs/bp-blogs-activity.php

    r11268 r11414  
    13011301    // Check comment depth and disable if depth is too large.
    13021302    if ( isset( buddypress()->blogs->thread_depth[$comment->item_id] ) ){
    1303         if ( bp_activity_get_comment_depth() > buddypress()->blogs->thread_depth[$comment->item_id] ) {
     1303        if ( bp_activity_get_comment_depth( $comment ) >= buddypress()->blogs->thread_depth[$comment->item_id] ) {
    13041304            $retval = false;
    13051305        }
Note: See TracChangeset for help on using the changeset viewer.