Skip to:
Content

BuddyPress.org

Opened 5 years ago

Closed 5 years ago

#8151 closed defect (bug) (fixed)

Avatar endpoints are loaded even they have been disabled from the WP Admin options screen

Reported by: imath's profile imath Owned by: imath's profile imath
Milestone: 5.1.0 Priority: normal
Severity: normal Version: 5.0.0
Component: REST API Keywords: has-patch commit
Cc:

Description

We should check for these settings before loading the Group and xProfile Avatar Attachment controllers.

Moreover, the User Avatar Endpoint should be attached to the xProfile component instead of the members component.

Attachments (3)

8151.patch (2.3 KB) - added by imath 5 years ago.
8151.2.patch (6.2 KB) - added by imath 5 years ago.
8151.3.patch (2.0 KB) - added by imath 5 years ago.

Download all attachments as: .zip

Change History (14)

@imath
5 years ago

@imath
5 years ago

#1 @imath
5 years ago

8151.2.patch is updating Unit Tests to take the fact Avatars are now loaded by the xProfile component and add tests to check the Member avatar controller is not loaded when avatar uploads are disabled.

#2 @imath
5 years ago

In 12482:

Only load BP REST API Avatar Controllers when avatar uploads are on

  • Move the loading of the BP_REST_Attachments_Member_Avatar_Endpoint controller into the xProfile component's class. User Avatar is an xProfile feature.
  • Make sure to check the community administrator allowed member avatar uploads before loading this controller.
  • Make sure to check the community administrator allowed group avatar uploads before loading BP_REST_Attachments_Group_Avatar_Endpoint.

See #8151 (Trunk)

#3 @imath
5 years ago

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

In 12483:

Only load BP REST API Avatar Controllers when avatar uploads are on

  • Move the loading of the BP_REST_Attachments_Member_Avatar_Endpoint controller into the xProfile component's class. User Avatar is an xProfile feature.
  • Make sure to check the community administrator allowed member avatar uploads before loading this controller.
  • Make sure to check the community administrator allowed group avatar uploads before loading BP_REST_Attachments_Group_Avatar_Endpoint.

Fixes #8151 (Branch 5.0)

#4 @imath
5 years ago

  • Keywords has-patch removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

It looks like it's best to revert these commits. For further details see this discussion on slack.

#5 @imath
5 years ago

In 12484:

Revert [12483]

For further details see this discussion on slack

Props espellcaste, johnjamesjacoby

See #8151 (Branch 5.0)

#6 @imath
5 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 12485:

Revert [12482]

For further details see this discussion on slack

Props espellcaste, johnjamesjacoby

Fixes #8151 (Trunk)

@imath
5 years ago

#7 @imath
5 years ago

  • Keywords has-patch commit added
  • Resolution fixed deleted
  • Status changed from closed to reopened

As discussed during October 30 dev-chat: until the Member Avatar dependency to xProfile is removed in BuddyPress Core, we will make sure to load the Member Avatar Controller only if the xProfile component is active.

8151.3.patch is moving the Member Avatar controller into the xProfile component.

Documentation about this fact has been updated, see Member Avatar chapter.

#8 @espellcaste
5 years ago

Perfect!

#9 @imath
5 years ago

Thanks for your feedback @espellcaste 😍

#10 @imath
5 years ago

In 12488:

Load the Member Avatar REST Controller from xProfile's component class

The Member Avatar feature needs the xProfile component to be active to be able to upload and delete local avatars. The developer documentation has been updated to inform about this requirement.

props espellcaste

See #8151 (Trunk)

#11 @imath
5 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 12489:

Load the Member Avatar REST Controller from xProfile's component class

The Member Avatar feature needs the xProfile component to be active to be able to upload and delete local avatars. The developer documentation has been updated to inform about this requirement.

props espellcaste

Fixes #8151 (Branch 5.0)

Note: See TracTickets for help on using tickets.