When our users upload an avatar and save, they can see the image. However, when logging out, and logging back in, the image is gone.

I've confirmed the images exist after upload in our sites/defaults/pictures directory

Any thoughts?

Comments

dsevcik’s picture

Permissions, even when we set to 777, the image does not display upon logging back in.

Initial permissions on the image are set to 664. But changing that still does not show them after we log back in.

The sites/default/files/picture has a 777 permission.

dsevcik’s picture

We've narrowed down the issue to the database. After saving the profile, the user.pictues field has an id for our image. When logging out, that field goes back to zero.

dsevcik’s picture

I found a function user_file_delete which sets the picture id to 0.

Why is this in the user.module file?

I tried commenting this out, but this did not help. Drupal still sets the picture field in the "users" table to 0.

dsevcik’s picture

The issue seems to be the user_load function does not return anything for $user_fields->picture and $user_fields->picture->uri.

$user_fields returns name and other items though.

Any thoughts?

dgastudio’s picture

same problem, any solution?

dsevcik’s picture

A friend helped fix this. It appears that the avatar_selection module had some bad queries in it. The fix was to update those queries, and then delete all your avatars, and then reload them.

dgastudio’s picture

i was using avatar selection too...

but that queries? in module? or in phpmyadmin?

thank u

upd. avatar dissapear after flush cache

dsevcik’s picture

The actual fix for code was in the module. After we fixed that to match the database columns, we deleted all the avatars and uploaded them again so that the database would be reset and matching.

gunwald’s picture

Can you please give a more specific explanation how you solved that problem? I am running Drupla 7.19 an have exactly the same problem. But what avatar module you are talking about, I am using Drupal's core functions for the user picture? So what exactly do I have to update to get rid of the problem?