Skip to:
Content

BuddyPress.org

Opened 6 years ago

Closed 5 years ago

#5494 closed defect (bug) (fixed)

BP 2.0 beta - Groups Avatars - Notice appears when Avatars are turned off

Reported by: shanebp Owned by:
Milestone: 2.1 Priority: normal
Severity: minor Version: 1.7
Component: Groups Keywords:
Cc: shane@…, tw2113@…

Description

[ When creating a ticket, 'Version' does not include an option for 2.0 ]

If Settings > Discussion > Avatar Display is not selected, then this notice appears wherever a Group Avatar (default or otherwise) is called:

Notice: Undefined property: stdClass::$avatar_thumb 
in /.../wp-content/plugins/buddypress/bp-groups/bp-groups-template.php 
on line 526

And an empty rectangle is shown, with an empty img src.

If a Group has an avatar, and then Avatar Display is turned off, then the Notice does not appear, but the empty rectangle is shown.

So maybe the issue lies in the backpat in bp_get_group_avatar() ?

[I don't see 'avatar_thumb' in BP_Groups_Template, at least as called by bp_has_groups() but I've missed the obvious before. ]

Related... ?
When avatars are turned off, the Notice does not appear for Members ( Group or otherwise ).
But in the Group Members screen, the area where the member avatar would appear is still there, so the member's name is pushed down.

Change History (6)

#1 @boonebgorges
6 years ago

  • Version set to 2.0

#2 @boonebgorges
6 years ago

  • Milestone changed from Awaiting Review to 2.1
  • Severity changed from normal to minor
  • Version changed from 2.0 to 1.7

Did some more investigation. I can reproduce the issue at least back to 1.7.x, and looking through the logs it looks like it goes back way further than that.

Let's look for a proper fix in 2.1.

#3 @tw2113
5 years ago

I don't see 'avatar_thumb' in BP_Groups_Template, at least as called by bp_has_groups() but I've missed the obvious before.

Nor am I, so you're not alone with that fact.

Part of me wants to suggest removing the image tag completely, but then I worry about the possibility that someone has used bp_get_group_avatar filter, so that's more out of the question. But, then there needs to be some sort of default image that we can set to the $avatar_thumb property in BP_Groups_Template. It doesn't look like there's any sort of "default" image sets available other than mystery man, and that's intended as a user avatar, not group.

#4 @tw2113
5 years ago

  • Cc tw2113@… added

#5 @imath
5 years ago

In 8737:

Disable Group avatar feature if WordPress show avatars setting is disabled

In WordPress Administration Discussion settings, if the option "Show Avatars" is not on, we need to disable the Group Avatar feature to avoid some notices and be consistent with the discussion option.

Fixes #5345
See #5494

#6 @DJPaul
5 years ago

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

I'm not able to reproduce this error any more, so going to assume imath's patch (or something else that has gone in since this ticket was made) has fixed this.

Note: See TracTickets for help on using tickets.