[buddypress-trac] [BuddyPress Trac] #7329: Notice: Trying to get property of non-object

buddypress-trac noreply at wordpress.org
Wed Dec 21 01:55:33 UTC 2016

#7329: Notice: Trying to get property of non-object
 Reporter:  slaFFik                |       Owner:
     Type:  defect (bug)           |      Status:  new
 Priority:  normal                 |   Milestone:  2.7.4
Component:  Administration         |     Version:  2.7
 Severity:  normal                 |  Resolution:
 Keywords:  2nd-opinion has-patch  |
Changes (by r-a-y):

 * version:   => 2.7


 Thanks @slaFFik for discovering this bug and sorry for getting to this
 kinda late.

 The main thing we need to address here is finding the current activity
 comment depth when we're not in the activity comment loop.

 `02.patch` is an attempt at this.

 This is what is happening in the patch:
 - When we pass `$comment` to `bp_activity_get_comment_depth()`, we pull up
 the root activity update and the entire activity comment tree.
 - Next, we try to iterate over the entire tree to find the current
 comment.  Once we've found the comment, we use the calculated depth from
 `BP_Activity_Activity:get_activity_comments()`.  This can be kind of
 intensive depending on how many comments are in the tree.
 - Lastly, since activity items in the Activity dashboard are displayed in
 stream mode, we need to iterate the depth number so
 `bp_blogs_can_comment_reply()` knows when to disable activity comment
 replies.  This is a little bit of a hack, but if we want to avoid this, we
 can add a conditional so this is only done in the WP admin dashboard.

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7329#comment:12>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list