BuddyDev

Search

[Resolved] Issue with profile photo (BuddyPress Profile Completion)

  • Participant
    Level: Enlightened
    Posts: 25
    imborx on #22844

    Hi,

    I just setup the BuddyPress Profile Completion and it works perfect with profile fields, but I’m having some troubles with profile photo. I activate a register/login FB plugin and it takes the photo of the facebook username. Don’t know why but after the register, it gives you an error and
    says “You need to upload a profile photo”… so it seems like a bug (?) Take a look with this little video: https://i.gyazo.com/6b922d98e86e376f9f641ac7d75453d0.mp4 is there any way to check if user has already a profile photo (no matter if he uploaded previously or take from other source)?

    Thanks a lot!

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2935
    Ravi on #22847

    Hello Imborx,

    Sorry for the inconvenience, Please let me know which plugin are you using for FaceBook login. Yes, BuddyPress has a function name “bp_get_user_has_avatar( $user_id )” to check weather user has uploaded avatar or not. But with FaceBook Login it might keep FaceBook profile url as avatar.

    Regards
    Ravi

  • Participant
    Level: Enlightened
    Posts: 25
    imborx on #22943
    This reply has been marked as private.
  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2935
    Ravi on #22963

    Hello Imborx,

    Thank you for sharing the details. Please download the latest version of the plugin and paste the following code in your active theme “functions.php” file. Please let me know if it works or not.

    
    /**
     * If user has not uploaded any avatar and has facebook id set. Do not display has avatar message
     *
     * @param bool $has_avatar Has uploaded avatar or not.
     * @param int  $user_id User id.
     *
     * @return bool
     */
    function buddypress_profile_completion_has_uploaded_avatar( $has_avatar, $user_id ) {
    	if ( ! $has_avatar && get_user_meta( $user_id, '_fbid', true ) ) {
    		$has_avatar = true;
    	}
    
    	return $has_avatar;
    }
    
    add_filter( 'buddypress_profile_completion_has_uploaded_avatar', 'buddypress_profile_completion_has_uploaded_avatar', 10, 2 );
    
    

    Regards
    Ravi

  • Participant
    Level: Enlightened
    Posts: 25
    imborx on #22965

    Hi, thanks a lot! I just download the new version and add that code and it works for image but… when I register with FB and BuddyPress Profile Completion it’s active, the website don’t redirect you to your profile. If I deactivate BuddyPress Profile Completion redirection works perfectly. So that bug it’s quite annoying… could you help me?

    If you need credentials to test on my site just ask me

    Thanks!

  • Participant
    Level: Enlightened
    Posts: 25
    imborx on #22967
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 24211
    Brajesh Singh on #22978

    Hi,
    Ravi will be available in the afternoon(hopefully) tomorrow and will assist you.

    Regards
    Brajesh

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2935
    Ravi on #22992
    This reply has been marked as private.
  • Participant
    Level: Enlightened
    Posts: 25
    imborx on #22993
    This reply has been marked as private.
  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2935
    Ravi on #22999

    Hello Imborx,

    Thank you for sharing the details. I have checked and noticed that Facebook register plugin has their on redirect which is conflicting with the “BuddyPress Profile Completion” as with Facebook register there is not all required fields are filled by user. If I deactivate “BuddyPress Profile Completion” option not to redirect if required are not fulfilled then all goes well. User gets redirected to their profile.

    Regards
    Ravi

The topic ‘ [Resolved] Issue with profile photo (BuddyPress Profile Completion)’ is closed to new replies.

This topic is: resolved