[buddypress-trac] [BuddyPress] #2239: if an activity is hidden from sitewide its children (comments) are not hidden as well

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Wed Mar 31 02:51:35 UTC 2010


#2239: if an activity is hidden from sitewide its children (comments) are not
hidden as well
----------------------------+-----------------------------------------------
 Reporter:  francescolaffi  |       Owner:                                 
     Type:  defect          |      Status:  new                            
 Priority:  major           |   Milestone:  Future Release                 
Component:  Activity        |    Keywords:  activity,comments,hide sitewide
----------------------------+-----------------------------------------------
Changes (by cnorris23):

  * milestone:  => Future Release


Comment:

 I agree that it would be better to have this done automagically, but from
 looking at the code, I believe that everything is behaving exactly as
 intended. I'm still trying to fully grasp what's going on in this part of
 the code, but from what I can tell everything is as it should be. Until
 this functionality is purposed for the front end I'm guessing it's not
 going to get a whole lotta love. However, you can still get the
 hide_sitewide flag for the comment tree updated.

 In your update function, you could do something like this:

 {{{
 // code leading up to bp_activity_add()
 bp_activity_add( $args );

 // $child_comment_args would be an array/object filled with all your
 arguments
 if ( $child_comments = BP_Activity_Activity::get_child_comments(
 $parent_id ) {
    foreach ( $child_comments as $child_comment ) {
       // add check for existing child comment hide_sitewide value
       // if different, add new value to $child_comment_args
       bp_activity_add( $child_comment_args );
    }
 }
 }}}

 This is essentially the same thing that would be done if it were to be
 added to core.

-- 
Ticket URL: <https://trac.buddypress.org/ticket/2239#comment:1>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list