[buddypress-trac] [BuddyPress Trac] #8484: Bug in bp_nouveau_get_activity_entry_buttons function when bp_nouveau_get_activity_entry_buttons filter returns empty array

buddypress-trac noreply at wordpress.org
Mon Jun 7 21:55:57 UTC 2021


#8484: Bug in bp_nouveau_get_activity_entry_buttons function when
bp_nouveau_get_activity_entry_buttons filter returns empty array
-------------------------+-----------------------------
 Reporter:  sbrajesh     |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Core         |    Version:  8.0.0
 Severity:  normal       |   Keywords:  has-patch
-------------------------+-----------------------------
 Hi,
 There is a bug in `bp_nouveau_get_activity_entry_buttons()`
 When a function hooked to filter 'bp_nouveau_get_activity_entry_buttons'
 returns an empty array( I was trying to hide the action buttons for an
 activity when it is under moderation), The function return $buttons
 incorrectly.

 This causes php to throw notice and show Array Array Array where action is
 expected($buttons is multi dimensional array).

 The following line
 {{{
                 if ( ! $buttons_group ) {
                         return $buttons;
                 }
 }}}
 should be changed to


 {{{
                 if ( ! $buttons_group ) {
                         return array();
                 }
 }}}

 I am not return $buttons_group as the return expects an array and if some
 code returns incorrect value type, it will cause issue in future.

 Please update.

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8484>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list