Skip to:
Content

BuddyPress.org

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#2578 closed defect (bug) (fixed)

bp_get_activity_avatar() for components do not work

Reported by: r-a-y's profile r-a-y Owned by:
Milestone: 1.2.6 Priority: normal
Severity: Version:
Component: Activity Keywords: has-patch
Cc:

Description

If you take a look at the bp_get_activity_avatar() function, it appears that the code takes into consideration avatars for other components.

eg. If you created a group activity update, the group avatar should show instead of the default user one

However, there are some redundant checks for the user ID that breaks this functionality.

The attached patch based on the BP 1.2 branch fixes this.

The only thing I haven't taken into consideration is the link for the avatar. Right now, it also defaults to the user's link, should it link to the component's home page?

If so, I can create a patch for the bp_get_activity_user_link() function as well.

---

Thanks to Anton for posting about this on the forums:
http://buddypress.org/community/groups/creating-extending/forum/topic/group-avatar-in-activity-stream/

Attachments (1)

2578.001.patch (1.2 KB) - added by r-a-y 14 years ago.

Download all attachments as: .zip

Change History (3)

@r-a-y
14 years ago

#1 @johnjamesjacoby
14 years ago

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

(In [3168]) Fixes #2578. (1.3 early bird special)

#2 @johnjamesjacoby
14 years ago

Primary avatars are always users, since groups and blogs don't do anything on their own. With that in mind, I introduced the bp_activity_secondary_avatar and bp_get_activity_secondary_avatar functions, that will behave according to the object and item_id for that activity.

This gives us functions to work with to tick off secondary activity avatars off the 1.3 when the time comes also. All it needs is a str_replace on the bp_activity_action to insert it in there, which can be done with a filter to get it off the ground.

Note: See TracTickets for help on using tickets.