#8484 closed enhancement (fixed)
Bug in bp_nouveau_get_activity_entry_buttons function when bp_nouveau_get_activity_entry_buttons filter returns empty array
Reported by: | sbrajesh | Owned by: | imath |
---|---|---|---|
Milestone: | 9.0.0 | Priority: | normal |
Severity: | normal | Version: | 8.0.0 |
Component: | Core | Keywords: | has-patch |
Cc: |
Description
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.
Thanks for your report and patch π. Letβs include it in next minor release