#7420 closed defect (bug) (fixed)
Incorrect Format of apply_filters_ref_array for bp_get_group_name within class-bp-groups-list-table.php
| Reported by: | garrett-eclipse | Owned by: | boonebgorges |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.8.1 |
| Component: | Groups | Version: | 2.7.2 |
| Severity: | normal | Keywords: | has-patch needs-testing |
| Cc: |
Description
Hello,
I noticed this issue as I was adding a filter for bp_get_group_name and expecting 2 parameters but got an error on the Groups listing caused by the incorrect format of apply_filters_ref_array for bp_get_group_name within class-bp-groups-list-table.php;
https://github.com/buddypress/BuddyPress/blob/master/src/bp-groups/classes/class-bp-groups-list-table.php#L523
<?php $group_name = apply_filters_ref_array( 'bp_get_group_name', array( $item['name'] ), $item );
This is invalid as apply_filters_ref_array only supports two params the second being an array, the above provides three params.
Code should have the $item within the array, this will allow filters to receive both attributes properly.
Correct Code;
<?php $group_name = apply_filters_ref_array( 'bp_get_group_name', array( $item['name'], $item ) );
*The $group param was added in 2.5 for the bp_get_group_name filter in the above code $item is the group.
Thank you
Attachments (1)
Change History (9)
#1
@
9 years ago
- Component Core → Groups
- Keywords needs-patch good-first-bug added
- Milestone Awaiting Review → Future Release
#2
@
9 years ago
- Keywords has-patch added; needs-patch good-first-bug removed
Hi @DJPaul,
will you please take a look. if all right in this patch please accept it. because the issue is something which errors and it should get fixed in BuddyPress asap.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
yep, good spot.