[buddypress-trac] [BuddyPress Trac] #6708: Cannot upload group or member photos/avatars

buddypress-trac noreply at wordpress.org
Tue Nov 10 13:39:48 UTC 2015


#6708: Cannot upload group or member photos/avatars
--------------------------------+------------------------------
 Reporter:  Plucker             |       Owner:
     Type:  defect (bug)        |      Status:  new
 Priority:  normal              |   Milestone:  Awaiting Review
Component:  Component - Groups  |     Version:  2.3.3
 Severity:  normal              |  Resolution:
 Keywords:                      |
--------------------------------+------------------------------

Comment (by imath):

 I'm sorry, but i can't reproduce. Everything works fine for me on my local
 dev or on my test drive as i've explained earlier.

 I don't think it's a permission issue, as directories are created and some
 files are uploaded/created using the 'take a photo' feature (if i
 understood well).

 i agree that this > `wp-content/uploads/group-avatars/4/group-avatars/4`
 is confusing. We'll take care of it in this ticket #6555.

 It looks like when WordPress does this
 {{{
 $move_new_file = @ copy( $file['tmp_name'], $new_file );
 }}}

 in [https://core.trac.wordpress.org/browser/trunk/src/wp-
 admin/includes/file.php#L349 _wp_handle_upload], the result of the copy is
 false although your file has been uploaded (if i understood well again). A
 possible reason about why it's not happening for regular WordPress media
 is that WordPress uses 'move_uploaded_file' instead of 'copy'


 You can try to know more about why the temporary file copy failed by using
 this kind of code into a bp-custom.php file:

 {{{
 add_filter( 'bp_avatar_is_front_edit', '__return_false' );

 function dump_uploaded_file( $file ) {
         $uploads = wp_upload_dir();
         $filename = wp_unique_filename( $uploads['path'], $file['name'] );

         wp_die( sprintf( 'WordPress is trying to copy %s to %s',
 $file['tmp_name'], $uploads['path'] . '/' . $filename ) );
 }
 add_filter( 'bp_avatar_upload_prefilter', 'dump_uploaded_file', 10, 1 );
 }}}

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6708#comment:24>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list