Skip to:
Content

BuddyPress.org

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#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)

2212.patch​ (641 bytes ) - added by 1naveengiri 10 years ago.
I added that argument in correct place in this patch.

Download all attachments as: .zip

Change History (9)

#1 @DJPaul
10 years ago

  • Component Core → Groups
  • Keywords needs-patch good-first-bug added
  • Milestone Awaiting Review → Future Release

yep, good spot.

@1naveengiri
10 years ago

I added that argument in correct place in this patch.

#2 @1naveengiri
10 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.

Last edited 10 years ago by 1naveengiri (previous) (diff)

#3 @bhargavbhandari90
10 years ago

  • Keywords needs-testing added

This ticket was mentioned in ​Slack in #buddypress by djpaul. ​View the logs.


10 years ago

#5 @DJPaul
10 years ago

  • Milestone Future Release → 2.8.1

#6 @boonebgorges
10 years ago

  • Owner set to boonebgorges
  • Resolution → fixed
  • Status new → closed

In 11440:

Fix incorrect apply_filters_ref_array() syntax.

Introduced in [8426].

Props garrett-eclipse, 1naveengiri.
Fixes #7420.

#7 @boonebgorges
10 years ago

In 11441:

Fix incorrect apply_filters_ref_array() syntax.

Introduced in [8426].

Ports [11440] to the 2.8 branch.

Props garrett-eclipse, 1naveengiri.
Fixes #7420.

This ticket was mentioned in ​Slack in #buddypress by 1naveengiri. ​View the logs.


10 years ago

Note: See TracTickets for help on using tickets.