Skip to:
Content
Pages
Categories
Search
Top
Bottom

Avatar Upload Problem During Registration

  • During Registration , on the process of avatar upload, I can upload, crop and save avatar , and its showing succesfull message.
    But after login I found No avatar is shows for the user , it happened twice with two User Registration Process.

    After the login I have to reupload the avatar from change avatar in Profile, and then only it worked.

    How to solve the issue ?

Viewing 21 replies - 1 through 21 (of 21 total)
  • any clue please ?


    chestnut_jp
    Member

    @chestnut_jp

    @AnindyaRay
    If your case is that uploaded avatar is not be displayed but Gravatar is, see the following topic and try my post:
    https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/avatars-of-member-not-showing-in-all-blogs

    Same identical situation:

    * WP 3.2.1
    * BP 1.2.9

    During registration, Users try to upload image. They crop it, system shows successiful message, but displays mistery man (standard avatar) (no file are uploaded in /avatars)

    If this user log in, goes to his profile and changes avatar through the profile settings panel, it works like a charm.

    Anyone with a solution?
    Any


    lifemore
    Participant

    @lifemore

    I also have the same problem. Can you please, please help?
    Thank you so much;
    Vida

    @lifemore, could you share your configuration?


    lifemore
    Participant

    @lifemore

    Yes, I am using the latest version of WordPress, the latest version of Buddypress, and latest version of Suffusion theme. There was no problem a while ago, but now the avatar does not upload on the first page even though it shows successful avatar upload :(

    I truly appreciate your help.


    lifemore
    Participant

    @lifemore

    I am still hoping to get some help with this. The above problem that is.

    Pleeeeeaaaase?

    Thank you so much;


    enderandrew
    Member

    @enderandrew

    Have you guys checked the file permissions of the avatar folder to make sure Buddypress can write files there?

    @enderandrew, of course. are 755 for each folder. I’ve tried to switch to 777, no way.

    I think it’s not a problem about dir premission: uploading avatars through profile->change avatar (instead last step on registration process) it works like a charm.

    wow, just tested: downgrading from bp 1.2.9 to bp 1.2.8…. it works!

    well…but I’ve found several bugs using wp 3.2.1 & BP 1.2.8, so I’ve upgraded to 1.2.9 and the problem (no avatar upload in registration) still here.

    So, a quick overview:

    wp 3.2.1 + BP 1.2.8 = it works
    wp 3.2.1 + BP 1.2.9 = not working

    so…not a problem about folder permission…


    lifemore
    Participant

    @lifemore

    Thank you so much guys for solutions.

    1) How can I downgrade to BP 1.2.8?

    2) And would that be OK? Won’t we miss on some other improvements in BP 1.2.9?

    Thank you so much for your response.

    Vida


    lifemore
    Participant

    @lifemore

    Ok. It’s definitely BP 1.2.9 causing the avatar upload at registration.

    I downgraded to 1.2.8 and it works. Not sure what I will be missing, not upgrading to 1.2.9. But for now, keeping 1.2.8!

    As I wrote, I found several bugs running wp 3.2.1 & BP 1.2.8, so before keep it on BP1.2.8, check your WP system.

    In my installation a lot of ajax was broken (ie: new post->Publish->change publishing date descending effect) so I’ve re-installed BP1.2.9 and I’m searching for a solution.

    Hi folks

    I think I may have found a solution, at least to how I was experiencing it.

    I am using wp 3.2.1. and BP 1.2.9 with a bp-default child theme

    FIRST the default gravatar image was not showing at all in firefox. I don’t use gravatars on my site and filter them out all together. I applied a filter to
    bp_get_signup_avatar
    to replace the gravatar.com image with a link to mysteryman directly on my site.

    SECOND

    I think the function

    bp_get_signup_avatar_dir_value() in bp-core-templatetags.php

    has a bug.

    The last line applies the filter.

    Code:
    return apply_filters( ‘bp_get_signup_avatar_dir_value’, $bp->signup->avatar_dir );

    However, when the user signups up or uploads an avatar $bp->signup->avatar_dir seems to be empty.

    There are a few if then else statements that work with $signup_avatar_dir so this seems to be the relevant value to pass along. I changed the last line in the function code to

    Code:
    return apply_filters( ‘bp_get_signup_avatar_dir_value’, $signup_avatar_dir );

    THIRD

    I found that register.php in the theme is lacking a hidden field for the signup avatar directory

    The relevant section is: (REF section A)

    Code:
    <h4><?php _e( ‘Your Current Avatar’, ‘buddypress’ ) ?></h4>
    <p><?php _e( "We’ve fetched an avatar for your new account. If you’d like to change this, why not upload a new one?", ‘buddypress’ ) ?></p>

    <div id="signup-avatar">
    <?php bp_signup_avatar() ?>
    </div>

    <p>
    <input type="file" name="file" id="file" />
    <input type="submit" name="upload" id="upload" value="<?php _e( ‘Upload Image’, ‘buddypress’ ) ?>" />
    <input type="hidden" name="action" id="action" value="bp_avatar_upload" />
    <input type="hidden" name="signup_email" id="signup_email" value="<?php bp_signup_email_value() ?>" />
    <input type="hidden" name="signup_username" id="signup_username" value="<?php bp_signup_username_value() ?>" />
    </p>

    <?php wp_nonce_field( ‘bp_avatar_upload’ ) ?>

    You’ll notice that the section just below this that handles what the user sees when cropping has an additional hidden field.

    Code:
    <input type="hidden" name="signup_avatar_dir" id="signup_avatar_dir" value="<?php bp_signup_avatar_dir_value() ?>" />

    I inserted this in the (Section A) that the user sees before and after cropping

    Another relevant files is

    bp-core/bp-core-signup.php

    Looking at it, I am not sure my solution would be the final correct one. So far it’s working, but some of the functions in bp-core-signup seem like they would have an impact.

    Me again.

    I would like to edit the above posts, but this forum is not allowing me to do so. Clicking “Edit” gets me to “page not found.”

    Anyway. I take back that it’s necessary to add a hidden field.

    I think the change that is needed is
    the last line in the function
    bp_get_signup_avatar_dir_value()
    in bp-core-templatetags.php

    change
    return apply_filters( ‘bp_get_signup_avatar_dir_value’, $bp->signup->avatar_dir );
    to
    return apply_filters( ‘bp_get_signup_avatar_dir_value’, $signup_avatar_dir );

    However, I note that if the registrant uploads more than one avatar (i.e. replaces their avatar) during the registration process the avatar displayed will be the first one uploaded.

    Look at the function bp_core_fetch_avatar() in bp-core-avatars.php

    This is called in the function bp_get_signup_avatar in bp-core-templatetags.php.

    The problem is that if the user uploads more than one avatar the old ones are not deleted.

    bp_core_fetch_avatar() seems to get the first on uploaded and this is the one that is displayed when the register.php template runs even if newer avatars have been uploaded during the registration process.

    Tried some more tests. The pattern I seem to be seeing for repeated uploads during the registration process is that when a user replaces their avatar, the change is displayed a few times. After 2 or 3 it stops displaying new ones added. Not sure if this is a feature or bug or has to do with the order in which the avatars are listed in the registrations temporary avatar directory.


    lifemore
    Participant

    @lifemore

    Still pondering with this. Would you have a little plugin, or a simpler solution for this please? I do not seem to fully understand and adopt the above solution :(

    Thank you so much;

    Ehi @rbbp22, thank you so much for your work on this.

    Well, I’ve tried your solution, but the only thing I get is view the avatar changed after the cropping process (on the registration).

    When my user is going to load his profile after the login, the avatar will not displayed (there’ll be the default one).

    Seems something wrong in the ‘save’ process.

    Hi folks sorry, coming back to this after a while.

    I submitted my findings/questions to bp trac. They say that avatar upload during registration is going to be discontinued in bp 1.5 default theme. So, it may be a good idea to think about doing avatars after registration.

    Personally, I can see their thinking.

    1) Why let people who aren’t yet committed users get access to your file system?
    2) registration is really complicated by the fact that you don’t yet know the user’s user id.

    Still, I may be looking at this some more …

Viewing 21 replies - 1 through 21 (of 21 total)
  • The topic ‘Avatar Upload Problem During Registration’ is closed to new replies.
Skip to toolbar