Skip to:
Content

BuddyPress.org

Opened 13 years ago

Closed 13 years ago

#3500 closed defect (bug) (fixed)

Get correct avatar thumbnail size in single activity view

Reported by: jonnyauk's profile Jonnyauk Owned by:
Milestone: 1.5 Priority: minor
Severity: minor Version:
Component: Activity Keywords: has-patch
Cc: contact@…

Description

When you are viewing a single activity item the size parameters are set correctly to fetch the avatar ($bp->avatar->full->height, $bp->avatar->full->width), but the actual image file fetched is the smaller thumbnail.

FILE: bp-activity/bp-activity-template.php
FUNCTION: bp_get_activity_avatar()
In bp_get_activity_avatar() there is a check for this, but the $type variable is still set to 'thumb' from when it is called in bp-themes.bp-default/activity/entry.php

Patch attached for bp_get_activity_avatar() function
1) Double check it is a single activity view
2) Stop $type variable being polluted, set to 'full' to pass onto bp_core_fetch_avatar()

Attachments (3)

patch-01.diff (788 bytes) - added by Jonnyauk 13 years ago.
3500.02.patch (1.1 KB) - added by boonebgorges 13 years ago.
3500.03.patch (2.2 KB) - added by Jonnyauk 13 years ago.

Download all attachments as: .zip

Change History (6)

@Jonnyauk
13 years ago

#1 @boonebgorges
13 years ago

  • Component changed from Core to Activity
  • Milestone changed from Awaiting Review to 1.5
  • Priority changed from normal to minor
  • Severity changed from normal to minor

Good call. This is definitely a bug.

It seems to me that the check for 'thumb' == $type && bp_is_single_activity() is a hack. If we want a full avatar, we should request it. I've attached 3500.02.patch, which has what is, IMO, a better solution (it sets an intelligent default, and removes the argument from the template). Just need someone to glance at it and make sure it won't break existing themes. I'm pretty sure it will be backward compatible.

#2 @Jonnyauk
13 years ago

  • Cc contact@… added

Agreed - much clearer for users to see whats going on if correct params used in theme file rather than hack in bp_get_activity_avatar() - I was just building on what was already in there!

I also noticed that my 01 patch was polluting the comments on single view and loading the large avatar thumbnails and reszing to the smaller height - was just working through, but 3500.02 and 3500.03 patches fix this.

New patch attached (3500.03) - remove bp_is_single_activity and combine backpat code for $bp avatar sizes in bp_get_activity_avatar.

Version 0, edited 13 years ago by Jonnyauk (next)

@Jonnyauk
13 years ago

#3 @boonebgorges
13 years ago

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

(In [5019]) Load the full-size avatar image on activity permalink pages. Refactor avatar height/width fallbacks to make the code clearer. Fixes #3500. Props Jonnyauk

Note: See TracTickets for help on using tickets.