Plugin: BuddyPress Media

Join this plugin group to follow comments, support topics and reviews.

Unable to upload (49 posts)

Started 1 year, 2 months ago by: memorycrisis

  • Profile picture of memorycrisis memorycrisis said 1 year, 2 months ago:

    Hello there, i’m having a problem with BP- Album+ Version 0.1.8.7 and was hoping you could help.
    I had no problems installing or activating the plug in but when I try to upload a photo I get the following error message….

    Please upload only JPG, GIF or PNG photos.

    The photos I am trying to upload are JPG. Any ideas please? Thanks!

  • Profile picture of TheArtofBalance TheArtofBalance said 1 year, 2 months ago:

    I’m having the same problem, did you upgrade Buddypress and Wordpress today? If so, I think that has something to do with it. Hang tight I’m sure they’re already working on a fix.

  • Profile picture of memorycrisis memorycrisis said 1 year, 2 months ago:

    Yes I also upgraded them both today.

  • Profile picture of zkwc zkwc said 1 year, 2 months ago:

    @foxly I am also having the exact same issue after upgrading. the BP Album + settings under the general Buddypress plug-in settings has also disappeared. So, can’t check to see if settings are correct.

    lots of my plug-ins have also disappeared under the buddypress plug-in settings on admin dashboard. for instance – “welcome pack” settings have gone away. Can’t check those either.

    hopefully the plug-in developers will notice and make super killer adjustments. :)

  • Profile picture of foxly foxly said 1 year, 2 months ago:

    @memorycrisis
    @TheArtofBalance
    @zkwc

    We’re aware of the problem (this one is WordPress’ fault and has affected thousands of other plugins) and we should have a fix out within 24 hours.

    ^F^

  • Profile picture of sjo jen sjo jen said 1 year, 2 months ago:

    It still works on WP 3.1 if you use BP 1.2.7. So just use that until they send out the patch

  • Profile picture of zkwc zkwc said 1 year, 2 months ago:

    @foxly – you are a badass! thanks so much!!

  • Profile picture of foxly foxly said 1 year, 2 months ago:

    @memorycrisis
    @TheArtofBalance
    @zkwc

    Actually, it creates an intermittent problem.

    I have a test install over here that has WordPress 3.1, BuddyPress 1.2.8, and BP-Album 0.1.8.7 all working together perfectly.

    ^F^

  • Profile picture of zkwc zkwc said 1 year, 2 months ago:

    @foxly – do you mean that it’s just my site that has the issue? or do you mean you figured out what wordpress did and now you’ve got it sorted? because for me it just flat out doesn’t work, even intermittently. yours isn’t the only plug-in it’s doing this to though. they’re all kind of tweaked, including my spam plug-ins. getting descended upon like bears looking for honey.

  • Profile picture of foxly foxly said 1 year, 2 months ago:

    @zkwc

    The admin menus were intermittent, the “Please upload only JPG, GIF or PNG photos.” problem is consistent.

    ^F^

  • Profile picture of memorycrisis memorycrisis said 1 year, 2 months ago:

    @foxly

    I’m having the problems on default settings of Wordpress 3.1, and Buddypress 1.2.8 . Both of these I have never used before and have not modified their code in any way.

  • Profile picture of foxly foxly said 1 year, 2 months ago:

    We’ll probably have this fixed in a few hours. Follow our twitter feed for up-to-the-second updates.

    http://bit.ly/eT6Mbk

    ^F^

  • Profile picture of memorycrisis memorycrisis said 1 year, 2 months ago:

    @foxly Thanks for all your feedback foxly. Very much appreciated!

  • Profile picture of TheArtofBalance TheArtofBalance said 1 year, 2 months ago:

    @foxly Thanks for the support. I had a feeling that Wordpress was the culprit. As soon as I applied the update, I knew it was going to break something. :) I’ll be following the feed, waiting for the fix.

  • Profile picture of andrew__k andrew__k said 1 year, 2 months ago:

    @foxly Are you guys having trouble coming up with a fix, or is it just a workflow/deployment/release issue?

    I have the latest versions of WordPress and BuddyPress on a live site, and this fixes it for me.

    THIS IS A FRAGMENT OF THE FILE, meant to replace the broken implementation of the ‘bp_core_check_avatar_type’ function ONLY. Don’t replace the whole file with this!

    // buddypress/bp-core/bp-core-avatars.php
    
    function bp_core_check_avatar_type_original_version($file) {
    	if ( ( !empty( $file['file']['type'] ) && !preg_match('/(jpe?g|gif|png)$/', $file['file']['type'] ) ) || !preg_match( '/(jpe?g|gif|png)$/', $file['file']['name'] ) )
    		return false;
    
    	return true;
    }
    
    /* Patched version by Andrew Koster */
    function bp_core_check_avatar_type($file)
    {
    	// Uncomment the following line to examine the data structure.
    	// print_r($file);
    
    	if (isset($file['file']))
    	{
    		// Before WordPress 3.1.
    
    		return bp_core_check_avatar_type_original_version($file);
    	}
    	else
    	{
    		// After WordPress 3.1 (sometimes).
    
    		if ( ( !empty( $file['type'] ) && !preg_match('/(jpe?g|gif|png)$/', $file['type'] ) ) || !preg_match( '/(jpe?g|gif|png)$/', $file['name'] ) )
    			return false;
    
    		return true;
    	}
    }

    The problem comes from the fact that we’re trying to validate a data structure that is extremely loosely defined. It has been changed it in some places, but not in others, so two different versions of the function are now needed.

    This is why using arbitrary data structures everywhere is a bad idea, IMO. A “FileInfo” class or something similar would avoid this kind of problem, or at least make it easier to debug.

    EDIT: The twitter link given in a previous post doesn’t work.