#3405 closed enhancement (wontfix)
bp_core_fetch_avatar() not getting most recently uploaded avatar
Reported by: | KChun | Owned by: | |
---|---|---|---|
Milestone: | 1.2.9 | Priority: | normal |
Severity: | minor | Version: | |
Component: | Core | Keywords: | |
Cc: |
Description
Version 1.2.9
in bp-core-avatars.php line 163, rewrite code to choose the most recent file time if there are more than 1 set of avatars.
Check for array
if ( 0 < count( $avatar_files ) ) {
$avatar_file_time=0;
$avatar_home_path=str_replace($bp->root_domain,ABSPATH,$avatar_folder_url);
Check for current avatar
foreach( $avatar_files as $key => $value ) {
if ( strpos ( $value, $avatar_size )!== false ) {
if($avatar_file_time < ($t=filemtime($avatar_home_path . '/' . $value))) {
$avatar_file_time=$t;
$avatar_url = $avatar_folder_url . '/' . $avatar_files[$key];
}
}
}
Change History (4)
#2
@
13 years ago
- Type changed from defect to enhancement
Core never stores more than one avatar. The old avatars should be removed after the cropping stage is completed.
#3
@
13 years ago
- Resolution set to wontfix
- Status changed from new to closed
I am going to close this ticket as a single item (user, group) should never have more than one set of uploaded avatars. Adding a filesystem check to get the time will potentially slow the function down on large sites. If you can point to a situation where avatars aren't being deleted on edit, with instructions on how to recreate, then that is a potentially a bug (or a server config issue) and the ticket can be reopened.
Your post in BP.org forums