#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 |
---|---|---|---|
Milestone: | 2.8.1 | Priority: | normal |
Severity: | normal | Version: | 2.7.2 |
Component: | Groups | 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
@
8 years ago
- Component changed from Core to Groups
- Keywords needs-patch good-first-bug added
- Milestone changed from Awaiting Review to Future Release
#2
@
8 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 this is something which errors and it should get Implemented in BuddyPress asap.
This ticket was mentioned in Slack in #buddypress by djpaul. View the logs.
8 years ago
#6
@
8 years ago
- Owner set to boonebgorges
- Resolution set to fixed
- Status changed from new to closed
In 11440:
yep, good spot.