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?
Comment | File | Size | Author |
---|---|---|---|
#3 | 615304_profile_image_time.patch | 1.28 KB | andypost |
#3 | imagecache_profiles.module.txt | 7 KB | andypost |
Comments
Comment #1
andypostThis 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]
Comment #2
rockwright CreditAttribution: rockwright commentedYep. 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.
Comment #3
andypostLet's try to add suffix for image as datetime
Patch against dev and module with patch (imagecache_profiles.module.txt remove .txt extension)
Comment #4
rockwright CreditAttribution: rockwright commentedAwesome, thanks for the good work.
Comment #5
andypost@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
Comment #6
rockwright CreditAttribution: rockwright commentedEverything seems to be working like a gem; put it up.
Comment #7
dipen chaudhary CreditAttribution: dipen chaudhary commentedWanted to let know that the patch works after a quick testing.
Comment #8
andypostThat's good, suppose now we need a setting for this.
Comment #9
sadist CreditAttribution: sadist commentedhi.
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)
Comment #10
andypostLooks bad, theme_image is encoding URL, second warning could be suppressed by prefixing @filemtime()
Comment #11
andypostThis 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
Comment #12
andypostI see no reason to change default core behavior, so let's continue with discussion
Comment #13
2c CreditAttribution: 2c commentedIf 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.
Comment #14
jaochoo CreditAttribution: jaochoo commentedI 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..
Comment #15
jaochoo CreditAttribution: jaochoo commentedSince 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 topicture-<uid>-<timestamp>.<ext>
instead of onlypicture-<uid>.<ext>
? What would be the correct usage ofhook_user()
(i.e. what $op etc. to use) and what variable does hold the filename of the picture?Comment #16
andypostThere'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
Comment #17
andypostPostponed til not fixed in core
Comment #18
Dave ReidWe should just mark this as a duplicate of that issue.