Opened 10 years ago
Closed 8 years ago
#6298 closed defect (bug) (fixed)
Admin toolbar avatar wrong when visiting WP admin's options-discussion.php page
Reported by: | henry.wright | Owned by: | r-a-y |
---|---|---|---|
Milestone: | 2.7 | Priority: | normal |
Severity: | normal | Version: | 2.4.0 |
Component: | Media | Keywords: | has-patch |
Cc: |
Description
Inside bp_core_fetch_avatar_filter()
there is:
// Do not filter if inside WordPress options page if ( 'options-discussion.php' == $pagenow ) return $avatar;
This causes an issue when viewing the options-discussion.php in the WP admin area.
Steps to reproduce:
- Upload a profile photo via /change-avatar/
- Visit the WP admin area, navigate around, and keep a close eye on your profile photo in the admin toolbar (top right-hand corner of the screen). You'll notice the profile photo displays nicely until you get to the options-discussion.php page (at which point you'll see something like the mystery person).
Attachments (1)
Change History (17)
#2
@
10 years ago
@Mamaduka
I'm not sure I agree an option for BP avatars under Default Avatar is a good idea. As a user, if I upload a profile photo then I expect it to display regardless of my 'default avatar' choice. The purpose of the 'default avatar' choice is set a fallback (for when there's no profile photo).
This ticket was mentioned in Slack in #buddypress by djpaul. View the logs.
10 years ago
#4
@
10 years ago
- Milestone changed from Awaiting Review to Future Release
This might be tricky to fix. I think we'd likely need to use a particular hook to unregister our filter after we've drawn the toolbar but before the avatar list on the page.
#5
@
9 years ago
- Keywords has-patch added
- Version set to 2.4.0
This might be tricky to fix. I think we'd likely need to use a particular hook to unregister our filter after we've drawn the toolbar but before the avatar list on the page
Those were my thoughts too. But now get_avatar()
accepts $args
, this can be done fairly easily (see attached patch).
The catch is it'll also require a WordPress patch (which I'll submit separately and add a link here) so please don't commit this unless the WP patch is accepted.
#7
@
9 years ago
This will be fixed in WordPress 4.6, see https://core.trac.wordpress.org/changeset/37227
#9
@
8 years ago
@henry.wright Do you want to re-check this issue on WP 4.6 RC and see if it's been fixed for us? :)
#11
@
8 years ago
@DJPaul Tested 6298.diff against WP 4.6 RC 1. Works great. Thanks @swissspidy
#12
@
8 years ago
- Milestone changed from Future Release to 2.7
- Resolution set to fixed
- Status changed from new to closed
Neat!
#13
@
8 years ago
@DJPaul No commit in BuddyPress needed to fix this?
@herny.wright
If we don't bail on discussion page, filter will break select "Default Avatar" setting and display BP avatar for every option. I think better solution will be to add BP avatar as an option to Default Avatar and respect users choice.