Avatar Upload Issues
-
There are numerous tickets in the trac and topics in the forums popping up. It seems lots of users are having issues uploading avatars with 1.1.2.
I’ve tested this on two different environments with subdomains and subdirectory installs and cannot duplicate the problem myself. However, we’re aware that it’s an issue and will keep trying to resolve it.
In the meantime, please route your avatar upload related discussion here. It will help us better monitor everyone’s experiences. Other topics regarding this issue will be locked and linked to this topic until it is resolved.
Thanks everyone for being awesome and patient and understanding. :thumbup:
-
i faced this problem in my new installation, so i will replicate it and report the results on bug fixes as soon as i’m decided on what theme i use for that site.. lol
@JJJ: Have you ever tried adding wp_enqueue_script( ‘thickbox’ ); to one of ur environments? This is what causes the upload issue on my two local installations. From what i read most plugins utilise this wordpress bundled function and i guess this could be a good starting point for further investigations.
@jjj : It seems to me that BP is not trapping the GD Lib error while creating a thumbnail when using wp_create_thumbnail function in bp-core-avatars.php around line no. 250 resulted, it render the Cropper UI without an image and without any error.
In this case while all file permission and everything are correct. But user won’t find his file on FTP because BP deletes the original file if its not in correct size.
So I would suggest that before reporting any avatar upload issue here on forum user should check that file permissions are correct and its creating thumbnails.
A very simple way to test this is.
1. Login to the admin interface with admin
2. Goto Media -> Add New and try uploading any image
– If upload works correctly, which means file permission are ok. If not check the file permission
– If upload works correctly, check that its creating thumbnails in 150X150 and 300X300 (default) for bigger images. This can be check by going to wp-content/blogs.dir/–Your Upload path–
If both are correct avatar upload might work.
Hope this helps
if Manoj’s error is what cause the problem, “maybe” it would be forced to have that verification made on the BP install, as a prerequisite… btw, i think it is already checked on WP install, as it is required to upload any media…
OK, I’m one of the people who started a thread on this a couple of weeks back.
I just followed the advice above given by Manoj. I am able to upload files via Add New Media, so indeed the file permissions are correct (which I noted in my previous posts).
But, when I upload a 700×700 image, it uploads correctly but I get no thumbnail images, so perhaps that is indeed the problem.
When I upload an Avatar (175×100 in all of tests so far), the directory “1” successfully gets created under the “avatars” directory, but no files appear there.
How do I specifically test for the GD Lib error mentioned above, and even better, how do I fix it if that’s the problem?
At that point I really think this sounds like some kind of conflicting JavaScript issue. This cropper is solid because it’s the same library used by WordPress 2.9’s image cropping feature, and I think it’s even the same one that Gravatar uses ( which fits the roadmap ability of being able to import a gravatar via the BuddyPress interface. )
Check if any other plugins are adding conflicting JavaScript, and see if there are any errors occurring in your site.
OK, my problem isn’t completely solved, but Manoj was right about what was going on for me. When I upgraded php to 5.3, somehow, I left off “–with-gd” in my build (I used to build with it). So, because the GD lib was missing, the upload was failing, having nothing to do with file permissions.
Now, I can successfully upload a file, but once the file is uploaded, I get sent to the “Crop” screen, and no matter what I do there (move the crop box around, leave it alone, etc.), when I press the Crop button, again I fail. So, I can’t get the new avatar to display (yet), but at least it uploads to the correct directory.
One step closer!
I’ve looked through this thread and can’t seen any reference to my particular problem I don’t think.
When I try to upload new avatars to a new WPMU+BuddyPress installation the following message is displayed:
Upload Failed! Error was: Unable to create directory /var/www/vhosts/terrywassall.org/httpdocs/blogs/wp-content/blogs.dir/1/files/avatars/3. Is its parent directory writable by the server?
There is a folder called:
blogs.dir 4.00 KB rwx r-x r-x Nov 6, 2009 apache apache
but it is empty and I do not have write access to it of change permissions.
Installation versions:
WordPress MU 2.8.5.2.
BuddyPress Version 1.1.2
I would be grateful for any suggestions.
PS I also get the following message when I try to upload a file (pdf so permitted type)
Unable to create directory /var/www/vhosts/terrywassall.org/httpdocs/blogs/wp-content/blogs.dir/1/files. Is its parent directory writable by the server?
I assume this is the same problem?
@terryw, your problem is actually not related to any bug here, but is based on the chmod, as the errors are clearly in english, the script is unable to create or write these folders, so the configuration of your server does not have create access in one or more directories… ask your webmaster then…
I am having a similar issue. When creating a new group… and I get to the upload a avatar step (3) the page is blank (no upload field appears) and I can not get to step four. It does setup the group however and if I go to my groups page and edit the new group, I then can go to step (3) and the upload field appears and works great. Does anyone know why it’s not working when I try to create the group in setup?
@nexia Thanks. I have contacted my ISP host and will see what happens. I’m probably out of my depth with this but will persevere. I thought maybe there was some edit I might have to do in a configuration or other file rather than a bug.
@nexia. Problem sorted! I contacted my web hosting service as you suggested. I had to run a script on-line (by filling out a form) to â€install php as a cgi module†and then they gave me permissions to the requisite folders and files. In addition I had to paste 3 lines of code into the .htaccess file in the document root folder. Now avatars upload and crop and I can also upload files. Thanks for the advice.
sudo aptitude install php5-gd
fixed the problem for me
Thanks but both permissions and thumbnail creation works for me but avatar and group avatar uploading does not.
EDIT: Correction, I can upload avatars after clearing out the user’s avatar folder via FTP. Unfortunately, I cannot delete these new avatars from the user’s Profile page without using FTP. So it does appear to be a permissions issue, where Buddypress cannot delete existing avatars. Ideas?
EDIT again: I found this old post from 1.1 on permissions. I expect this will help: https://buddypress.org/forums/topic/surprising-avatar-behavior
in “some” situations, the server refuse cURL access to check gravatar.com’s content, making it impossible to see the page where you have to select an avatar for your group or member… you can ask your webmaster about this, or we need a check thingy inside BP that would switch off any cURL access if it is disable on your installation.
Similar issues here. Just upgraded from pre 1.0 version to 1.1.2. My default admin avatar was replaced with one used by groups. I’m unable to delete it and if I try to upload a new one only the small thumbnail of the two is replaced with my new upload. Trying to upload a second time fails and then both the large and small are repopulated by the original incorrect group gravatar that was originally present right after upgrading…. not sure if this helps at all…
Also just noticed that most group avatars are not showing as well…
We have avatar uploading problems only with some users. After checking directories I suspect the problem stems from active users PRIOR to buddypress integration.
All users that signed up after we installed buddypress have no avatar problems.
Users that were already registered in wpmu prior to our buddypress install can upload avatar files but they are incorrectly (not) processed.
E.G. a prior user may have a blog ID=120 but when they try to upload an avatar then a directory is created in the wp-content/blogs.dir/1/files/avatars folder with number 131 (so not matching a blog ID).
Also the JPG files in that folder are not processed and retain their original name instead of the processed names like 7ba85e67359e35737060794b4690e67-bpthumb.jpg.
Hope this helps with debug ..
My question for now is: Is there a way to safely create a new avatar for the “broken” users through FTP while this bug is worked on ? e.g. can I create a folder with correct number and place image files in there ? (they would not have a processed name then) …
p.s. These users were assigned a random wavatar correctly at time buddypress was installed. It’s only when they change from random wavatar to their own pic that problems arise.
TEMPORARY WORKAROUND if you must change a user’s avatar (phew) :
– find user-dir in wp-content/blogs.dir/1/files/avatars
– change ownership of dir (it could be owned by apache)
– create a 50×50 image file ending in -bpthumb.xxx
– create a 150×150 image file ending in -bpfull.xxx
– upload the files , done …
we verified this procedure with 2 of our pre-BP users and updated their avatar this way. All post-BP install users have had no problems as far as we can see.
need more help ? http://superblogger.nl (it’s dutch but you can post in english on the forums), or wait a while until we revisit here.
If anyone with these avatar issues wants to volunteer to let me peek in at your installation, I’d like to try and fix this for 1.1.3 or at least 1.2. I am away on holiday until Monday, but PM me here if you’re interested in letting me check things out.
I was experiencing exactly the same problem that Tracedef describes after an upgrade from BP 1.0.3 to 1.1.3 (and WPMu 2.8.4a to 2.8.6, if it matters). Some users who’d been group admins (and uploaded group avatars) before the upgrade saw one of the group avatars on their profile page instead of their profile avatar. And when they tried to change the profile avatar, they were able to walk through the uploading and cropping process, but the group avatar was still displayed. It’s possible that the problem is only limited to users whose initial avatars were gravatars.
A bit of poking around showed that the portion of bp-core/bp-core-avatars.php that looks for avatar files in the user’s avatar directory (the first segment pasted below) was returning multiple filenames and settling on the final one, which happened in all cases to be group avatars rather than personal ones (even though personal replacement avatars had been subsequently uploaded and appeared in the user avatar directory).
I rewrote the logic of the loop just a little bit, so that $avatar_url would be preferentially set by a file named by the new avatar filename convention, and only failing that would it look for a legacy name. I replaced
if ( preg_match( "/{$avatar_name}/", $avatar_file ) || preg_match( "/{$legacy_user_avatar_name}/", $avatar_file ) || preg_match( "/{$legacy_group_avatar_name}/", $avatar_file ) )
$avatar_url = $avatar_folder_url . '/' . $avatar_file;with
if ( preg_match( "/{$avatar_name}/", $avatar_file ) ) {
$avatar_url = $avatar_folder_url . '/' . $avatar_file;
break;
} else if ( preg_match( "/{$legacy_user_avatar_name}/", $avatar_file ) || preg_match( "/{$legacy_group_avatar_name}/", $avatar_file ) ) {
$avatar_url = $avatar_folder_url . '/' . $avatar_file;
}After the change, I (one of the affected users) was able to upload a new avatar and have it stick, and group avatars appear to be functioning normally as well.
Not sure if this is a core bug or not. Maybe someone out there is smarter than me and can chime in?
InactiveI had the same problem and i had to go into the server and change the premmission of all the wp-content files
InactiveWe have installed wordpress and buddypress in our site.
After the last buddypress update we discovered that USERS can´t upload avatars.
Once they select the file and click UPLOAD they receive “(Error when uploading! The error was The file type does not meet security policies. Try another)”
BUT admin user can upload avatar without problems!!
We are using WordPress MU 2.8.6 and BuddyPress 1.1.3
Thanks!
Francisco
InactiveOk, I have searched everywhere for help, and been working on this problem for like a week solid! I am having a slightly different situation where as I keep getting the error message “There was a problem cropping your avatar, please try uploading it again”. I need an urgent fix!
This is what happens with a user (including admin):
1. Register/log in
2. Upload/Change Avatar
3. Crop Avatar screen comes up
4. Once ‘cropped’, the page refreshes to show “There was a problem cropping your avatar, please try uploading it again” with no avatar.
It is also not creating new folders on the blogs.dir and all permissions are set to 777.
Please forgive me for jumping on this thread as I feel this is a very similar issue to the above and if it does deserve a new topic please make one.
The website in question is http://freelancerunplugged.com.
– Diesel
InactiveJust so you know, I have since removed the upload feature and told people to go to the Gravatar website. I think this should just be a standard feature seeing as the support is there. Maybe streamlined integration with Gravatar?
I’m encountering the same issues
-fresh install off the trunk
-create a group
-upload avatar (default wp misc settings for wp-content/upload)
-verified the file is successfully uploaded to the server in proper directory/permissions
But inspecting in firebug shows the path is not exactly correct:
<img alt="Avatar to crop" class="avatar" id="avatar-to-crop" src="wp-content/uploads/group-avatars/1/myuploadedfile.png"/>
<img alt="Avatar preview" class="avatar" id="avatar-crop-preview" src="wp-content/uploads/group-avatars/1/myuploadedfile.png"/>
<input type="hidden" value="wp-content/uploads/group-avatars/1/myuploadedfile.png" id="image_src" name="image_src"/>needs a beginning slash
/wp-content/uploads/group-avatars/1/myuploadedfile.png
- The topic ‘Avatar Upload Issues’ is closed to new replies.