I like this module however, when a user uploads a new picture of himself in lieu of the old one, the new is one is present in his user profile page but the old one is also still present in his node pages. The new picture should be in his node pages just like on his profile page. I tried clearing the caches and resetting cron but the results don’t change. I read a review from drupalmodules.com about this module and a user claims a similar problem, “This did not sink up images, so on uploading new images users will often have one image of the new type and another on another area. Not recommended at this time. I hope it becomes better!” How can this problem be fixed?

Members fund testing for the Drupal project. Drupal Association Learn more


andypost’s picture

This problem related to core, not this module. Try to disable imagecache_profiles and change user picture... if you upload file with different extension so your picture is updated!

This caused by core which saves user pictures with a same name picture-[uid].[extension]

rockwright’s picture

Yep. You hit the nail on the head. For UGC sites, it’s inconvenient for users to have to do something like this and most likely, they’ll be oblivious. Most ordinary users will just upload a JPEG image of themselves and if they’re going to change a photo, most likely the new photo will also be a JPEG. When they save the changes, sometimes they’ll see the new photo and other times, they’ll see the previous photo. Regardless of what they’ll get in their profile page, they will almost always see the old photo in their associated nodes (be it something on which they originally authored or commented). So I did what you said and changed a photo in PNG format and the changes occurred immediately in both the profile and node pages without clearing the caches or resetting cron. I just wish changes to the photos occur immediately without having to change extensions.

andypost’s picture

Status: Active » Needs review
7 KB
1.28 KB

Let's try to add suffix for image as datetime

Patch against dev and module with patch (imagecache_profiles.module.txt remove .txt extension)

rockwright’s picture

Awesome, thanks for the good work.

andypost’s picture

@rockwright please check carefully that no files left after imagecache flush after user changes avatar

Anyway if it works fine so we can put it within ongoing release

rockwright’s picture

Everything seems to be working like a gem; put it up.

dipen chaudhary’s picture

Wanted to let know that the patch works after a quick testing.

andypost’s picture

That's good, suppose now we need a setting for this.

sadist’s picture


i'd tested the patch and it works. tho it will display on your browser, there's problem with the log entries. it will report a 404 error as the system will look for a wrong URL.

For example, instead of 'picture-1.jpg?1252920222' it will look for 'picture-1.jpg%3F1252920222'

And I also received this error printed at user's page who never upload their picture (I set to display a default picture)

warning: filemtime() [function.filemtime]: stat failed for no_picture.gif in /home/public_html/sites/all/modules/imagecache_profiles/imagecache_profiles.module on line 62.
warning: filemtime() [function.filemtime]: stat failed for no_picture.gif in /home/public_html/sites/all/modules/imagecache_profiles/imagecache_profiles.module on line 62.
andypost’s picture

Looks bad, theme_image is encoding URL, second warning could be suppressed by prefixing @filemtime()

andypost’s picture

Status: Needs review » Needs work

This patch caused a lot of troubles... so was rolled back away from 6-dev

Suppose better idea to add "last changed" field to user table and use this as timestamp for url generation

andypost’s picture

Version: 6.x-1.1 » 6.x-1.x-dev
Status: Needs work » Active

I see no reason to change default core behavior, so let's continue with discussion

2c’s picture

If you change imagecache.module function signature on line 312 to:

function imagecache_create_url($presetname, $filepath, $bypass_browser_cache = TRUE)

then it seems to be working.

jaochoo’s picture

I run into a similar (maybe the same issue): Our employees complain that the user pictures are not working because they still see their old picture. Sometimes clearing the browser cache does do the job, but then they are right claiming that the normal user does not have a clue about browser caches and Strg+F4 etc. and that it should not be his job anyways. Then sometimes I even have to flush the whole Drupal cache.

How can I solve the issues? We are running an intranet similar to a social network so this should not happen..

jaochoo’s picture

Since the filename of the user profile picture is written to the "user" table in the Drupal database: Wouldn't it be enough to use hook_user() to change the filename to picture-<uid>-<timestamp>.<ext> instead of only picture-<uid>.<ext>? What would be the correct usage of hook_user() (i.e. what $op etc. to use) and what variable does hold the filename of the picture?

andypost’s picture

There's a core patch waiting to be commited #668058: Resubmitting a user picture does show the first uploaded picture

Suppose this shoud fix this issue

andypost’s picture

Status: Active » Postponed

Postponed til not fixed in core

Dave Reid’s picture

We should just mark this as a duplicate of that issue.