Skip to:
Content

BuddyPress.org

Opened 5 years ago

Last modified 3 years ago

#5717 new defect (bug)

Default thumb avatar is not used when called via (any function that utilizes) bp_core_fetch_avatar()

Reported by: M-BP Owned by:
Milestone: Awaiting Contributions Priority: normal
Severity: normal Version: 1.2
Component: Core Keywords: needs-patch
Cc:

Description

The default thumb avatar (myster-man-50.jpg) is not used when avatars are called via any function that utilizes bp_core_fetch_avatar().

This is presumably due to the fact that on l. 468 in bp-core-avatars.php only bp_core_avatar_default() is called. This can lead to layout distortions (for example in the members loop) as well as makes it impossible to overwrite the default thumb avatar (see a related issue that someone posted in the forums http://buddypress.org/support/topic/bp_avatar_default_thumb-broken/).

Maybe $params could be checked and the function would just default to the thumb for the sake of consistency?

Change History (8)

#1 @M-BP
5 years ago

What do you think of this (from l. 466 onwards)?
I've made some tests and it seems to work but maybe it can be improved.

// No avatar was found, and we've been told not to use a gravatar.
	} else { 
                if ($params['type'] == 'full') {
                    	$gravatar = apply_filters( "bp_core_default_avatar_$object", bp_core_avatar_default( 'local' ), $params );
                }
                else {
                    	$gravatar = apply_filters( "bp_core_default_avatar_thumb_$object", bp_core_avatar_default_thumb( 'local' ), $params );
                }
	}

#2 @M-BP
5 years ago

  • Keywords dev-feedback added

#3 @boonebgorges
5 years ago

Can you give some more details about how to reproduce the problem?

#4 @M-BP
5 years ago

Sure, you will notice it everywhere where the default thumbnail is called (for me this is for example the case in the members-loop where type=thumb is requested). Else you will also always see this behaviour when using bp_core_fetch_avatar() or any other function that calls bp_core_fetch_avatar() without the type specified (you might have to turn off gravatars since this issue affects the default thumb that ships with bp, the myster-man).
When you then inspect the thumbnail <img> in your browser, you will notice that always the full version is loaded even if you specified type=thumb when calling bp_core_fetch_avatar().

Last edited 5 years ago by M-BP (previous) (diff)

#5 @r-a-y
5 years ago

  • Keywords dev-feedback removed
  • Milestone changed from Awaiting Review to 2.2
  • Version changed from 2.0 to 1.2

I can confirm this.

Moving to the 2.2 milestone.

#6 @DJPaul
5 years ago

  • Milestone changed from 2.2 to Future Release

#7 @slaFFik
3 years ago

  • Keywords needs-patch added
  • Milestone changed from Future Release to 2.8

#8 @DJPaul
3 years ago

  • Milestone changed from 2.8 to Future Release
Note: See TracTickets for help on using tickets.