Skip to:
Content

BuddyPress.org

Opened 3 months ago

Closed 3 weeks ago

#8437 closed defect (bug) (fixed)

'bp_core_avatar_default' filter is used twice, but for different purposes

Reported by: r-a-y Owned by: imath
Milestone: 8.0.0 Priority: normal
Severity: normal Version: 2.6.0
Component: Core Keywords: dev-feedback has-patch 2nd-opinion needs-docs
Cc:

Description (last modified by r-a-y)

In r10688, the 'bp_core_avatar_default' filter was introduced for a second time, but is used for a different purpose (see #6989). That filter is used in the generation of the Gravatar URL. We should rename this filter because it is causing a conflict when the real 'bp_core_avatar_default' filter is used. Perhaps rename the filter to 'bp_core_avatar_gravatar_default'?

The 'bp_core_avatar_default' filter was actually introduced back in BuddyPress 2.0 in r7769.

Attachments (1)

8347.patch (4.7 KB) - added by imath 4 weeks ago.

Download all attachments as: .zip

Change History (5)

#1 @r-a-y
3 months ago

  • Description modified (diff)

#2 @imath
3 months ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 8.0.0

Hi r-a-y,

Good catch 💪. Is there a way to know the purpose the filter was used for and then simply doing a doing_it_wrong feedback for one of the purpose or should we deprecate both filters ?

@imath
4 weeks ago

#3 @imath
4 weeks ago

  • Keywords has-patch 2nd-opinion needs-docs added; needs-patch removed

In 8347.patch I'm deprecating both filters and add some checks to see if the value is a default Gravatar or an URL to an avatar to eventually use the filtered value.

#4 @imath
3 weeks ago

  • Owner set to imath
  • Resolution set to fixed
  • Status changed from new to closed

In 12906:

Replace the bp_core_avatar_default filter with 2 new filters

The bp_core_avatar_default filter was used for two different purposes:

  1. to edit the default BuddyPress avatar [7769].
  2. to edit the default Gravatar [10688].

To avoid confusion or generate misleading behaviors, we are deprecating this filter in favor of 2 new filters :

  1. Use bp_core_default_avatar to edit the default BuddyPress avatar.
  2. Use bp_core_avatar_gravatar_default to edit the default Gravatar.

Props r-a-y

Fixes #8437

Note: See TracTickets for help on using tickets.