[buddypress-trac] [BuddyPress Trac] #6708: Cannot upload group or member photos/avatars
buddypress-trac
noreply at wordpress.org
Mon Nov 2 18:01:08 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: reporter-feedback |
--------------------------------+------------------------------
Changes (by imath):
* keywords: => reporter-feedback
Comment:
@Plucker The only way to get:
> Upload Failed! Error was: The uploaded file could not be moved to wp-
content/uploads/group-avatars/4/group-avatars/4
is that the uploads base dir does not contain the WordPress Absolute Path.
So a possible reason for this to happen is a plugin or a theme or a custom
code in bp-custom.php or in a mu-plugin folder is playing with the
WordPress uploads dir.
I've quickly built a testing tool, i understood your site were in
development, so could you test it?
{{{
function issue_6708() {
global $wp_filter;
add_filter( 'bp_displayed_user_id', '__return_true' );
add_filter( 'upload_dir', 'xprofile_avatar_upload_dir', 10, 0 );
$uploads = wp_upload_dir();
echo 'if there are other filters than xprofile_avatar_upload_dir,
you should check these.<br/>';
foreach( $wp_filter['upload_dir'] as $priority ) {
var_dump( array_keys( $priority ) );
}
remove_filter( 'upload_dir', 'xprofile_avatar_upload_dir', 10, 0
);
remove_filter( 'bp_displayed_user_id', '__return_true' );
echo 'Following line should be true, the Absolute path must be in
the upload basedir, and must start with it<br/>';
var_dump( 0 === strpos( $uploads['basedir'], ABSPATH ) );
echo '<br/>The uploads dir data is:<br/>';
var_dump( $uploads );
echo '<br/>Abspath is: ' . ABSPATH;
}
add_action( 'bp_actions', 'issue_6708' );
}}}
You should get something like this :
[[Image(https://cldup.com/PXvriw9Cot.png)]]
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6708#comment:13>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list