#2968 closed defect (bug) (fixed)
User Avatar won't show up in blogs outside buddypress site.
Reported by: | chestnut_jp | Owned by: | |
---|---|---|---|
Milestone: | 1.5 | Priority: | normal |
Severity: | Version: | 1.5 | |
Component: | Core | Keywords: | |
Cc: |
Description
At line 570 of /bp-core/bp-core-avatars.php:
$upload_dir[ 'baseurl' ] = str_replace( get_blog_option( $current_blog->blog_id, 'home' ) , get_blog_option( BP_ROOT_BLOG, 'home' ), $upload_dir[ 'baseurl' ] );
should be changed to:
$upload_dir[ 'baseurl' ] = get_home_url( BP_ROOT_BLOG, '/' ) . get_blog_option( BP_ROOT_BLOG, 'upload_path');
This is because the "upload_dir" for Primary Site(= buddypress site) is fixed at "/wp-content/uploads/" by WordPress 3.x.
Original Script points the "upload_dir" to /wp-content/blogs.dir/files/xxx, which is absolutely wrong.
Avatars of users who use gravatar are not influenced by the original script, but avatars that users uploaded for themselves are not shown in blogs outsite buddypress site.
(In [3851]) Fix URL to uploaded avatars on non-BP_ROOT_BLOG sites. Fixes #2451, #2574 and #2968. (branch)